Skip to content

Solver network

Abyss routes swap requests to registered solvers that compete on price from their own inventory. Each solver signs bids independently and settles winning orders directly on Midnight through the quoted settlement contract.

Status: Multi-solver routing is deployed on Midnight preprod and rolling into the app.

How solver routing works

  1. RFQ fan-out. When a trader requests a price, the Abyss quote API sends a versioned RFQ (v3-quoted-intent-rfq) containing the trade terms, protocolFee, batchIdHex, and expiry bounds to active solvers in the registry.
  2. Signed bids. Registered solvers price the request from their own inventory and return a bid signed with their BIP-340 x-only secp256k1 wallet key.
  3. Best output wins. The quote API verifies each signature against the solver registry and picks the highest valid output amount. Malformed, timed-out, or declined responses are ignored.
  4. Signed accepted quote. The quote authority signs the winning quote with its Jubjub key and returns an accepted-quote envelope to the trader's wallet.
  5. Single-transaction settlement. Once the trader locks sell tokens on Midnight (openQuotedOrder), the winning solver fills the order atomically (settleQuoted or settleShieldedQuoted), delivering the quoted output to the trader and receiving sellAmount - protocolFee.

Solver identity and registry

Each solver registered on Abyss provides:

  • id: unique identifier ([a-z0-9._-], 1 to 32 characters).
  • publicKeyHex: BIP-340 x-only secp256k1 key used to sign bids and authorize fills.
  • payoutHex: registered Midnight unshielded UserAddress where the solver receives proceeds.

The quote API pins each solver's key and payout address from the registry so a bid cannot substitute another address at quote time.

RFQ and bid messages

All hex fields are bare lowercase, amounts are canonical decimal strings in base token units, and timestamps are Unix seconds unless suffixed with Ms.

RFQ (quote API to solvers)

{
  "schemaVersion": 1,
  "kind": "v3-quoted-intent-rfq",
  "requestIdHex": "<escrow ID>",
  "batchIdHex": "<32-byte lowercase hex>",
  "authorizationNetworkHex": "<settlement network label>",
  "settlementHex": "<settlement contract address>",
  "terms": { "...": "QuotedEscrowTerms" },
  "protocolFee": "2500",
  "feeScheduleHashHex": "<64-char sha256 hex>",
  "bidDeadlineMs": 2000000001500,
  "minExpiresAt": "2000000300",
  "maxExpiresAt": "2000001200"
}

Signed bid (solver to quote API)

{
  "bid": {
    "requestIdHex": "<escrow ID>",
    "batchIdHex": "<32-byte lowercase hex>",
    "solverId": "acme",
    "solverHex": "<registered BIP-340 publicKeyHex>",
    "payoutHex": "<registered payoutHex>",
    "buyAmount": "990",
    "protocolFee": "2500",
    "expiresAt": "2000001200",
    "nonceHex": "<32-byte lowercase hex>"
  },
  "signatureHex": "<64-byte BIP-340 signature>"
}

A solver's payout upon settlement is sellAmount - protocolFee, so bids account for the protocolFee stated in the RFQ.

Fill-rate tracking and requirements

The quote API records settlement outcomes for issued quotes. Solvers that miss consecutive fills or fall below fill-rate thresholds are automatically paused from new auctions while existing accepted quotes remain settleable.

To run a solver on Midnight preprod, you need:

  • Independent Midnight wallet funded with the output tokens you intend to quote and enough NIGHT registered for DUST generation to cover your own transaction fees.
  • Midnight node, indexer, and prover access to watch finalized orders and submit atomic settlement transactions.
  • Low-latency bidding service signing valid bids before bidDeadlineMs.
  • Verifier checks confirming your solver targets the deployed Midnight settlement contract verifiers before filling.

Becoming a solver

Solver admission on preprod is managed via allowlist. If you operate a market-making desk or liquidity provider interested in quoting on Abyss, reach out to the Sommet Labs team via @abysstrade_.