Skip to content

Settlement contracts

Abyss settles swaps through smart contracts written in Compact, Midnight's zero-knowledge contract language. Every swap uses contract-to-contract (C2C) quoted settlement on Midnight. At no point does Abyss hold user tokens in a custodial account.

Quoted settlement

Abyss uses quoted settlement contracts (QuotedSettlement, plus a ShieldedBuySettlement variant for shielded payouts) so both sides of a swap settle atomically in a single transaction:

  1. Lock under a signed quote. Your wallet locks the sell amount inside the settlement contract (openQuotedOrder) together with the signed quote terms, your recipient address or shielded key, and an expiry deadline.
  2. Single-transaction fill. The quoted solver submits one transaction (settleQuoted or settleShieldedQuoted) that delivers the quoted output to you and releases your locked deposit to the solver together.
  3. Refund after expiry. If no solver fills the order before the quote expires, refundExpired (or refundShieldedExpired) returns your locked tokens directly to you in full.

Guarantees enforced on-chain

Guarantee How it is enforced
You receive the quoted output Verified by the settlement circuit before your locked deposit is released
One transaction pays both sides Atomic execution inside the settlement contract
Bounded protocol fee Enforced by an on-chain maxFeeBps cap; any fee comes from the solver's side, never added on top of your quote
Full refund if unfilled Expiry deadline enforced on-chain; no solver or Abyss signature required
Shielded payout privacy ShieldedBuySettlement commits output delivery directly to your shielded recipient key

Failure scenarios

Scenario Outcome
Solver never fills before expiry Your locked deposit refunds in full after the deadline passes via Orders → Refund. You pay only the Midnight network fee in DUST.
Solver attempts to pay less than the quoted output Rejected by the settlement circuit; your deposit cannot be released.
Abyss web app goes offline mid-swap Refunds are enforced directly by the contract on Midnight; no Abyss server action is required.
Another trade lands in the same block Your quote terms are already signed and locked in the contract, so competing trades cannot reprice your swap.

Audit status

The Compact settlement contracts run on Midnight preprod with test tokens and have not yet undergone an independent third-party security audit.