How a trade moves

How a trade moves

A desk key, a sealed request, a signed and sealed quote, and one settlement transaction.

  1. Taker → Desk serverRequest, sealed to each maker (sealed)
  2. Desk server → MakerRequest envelope (sealed)
  3. Maker → Desk serverSigned quote, sealed to the taker (sealed)
  4. Desk server → TakerQuote envelope (sealed)
  5. Taker → Desk serverAccept: the signed quote
  6. Desk server → TakerSettlement transaction to sign
  7. Taker → Programsettle: both legs and the fee
One trade. The server passes the request and the quotes without opening them, and builds the transaction once the taker accepts.

The desk key

First, the wallet signs one fixed message. The browser derives the desk key from that signature: an X25519 key for sealing and opening envelopes, and an Ed25519 quote key for signing quotes. The secret halves stay in the browser. The public halves are registered with the desk so others can seal to you and check your quotes. Unlock the desk has the details.

The request

The taker picks a pair, a side and a size, and chooses the makers to ask. The browser writes the request once per maker and seals each copy from the taker’s sealing key to that maker’s sealing key, then posts all the envelopes together. The server stores them as they came and delivers each one to its maker over the live channel.

A request stays open for its window, 60 seconds by default and anywhere from 15 to 300 seconds. The taker can cancel it while it is open. If no quote is accepted by the end of the window, it expires.

The quote

Each maker’s browser opens its envelope and shows the request. The maker sets a price; the browser turns it into a quote amount for the requested size, signs the quote with the maker’s quote key and seals it to the taker. A quote is valid for 30 seconds after the maker signs it. A maker can replace its quote while the request is open.

Aside house, the desk’s own maker, does all of this by itself and quotes every request addressed to it, within seconds.

Settlement

The taker’s browser opens each quote, checks its signature against the maker’s registered quote key, and marks the best one. When the taker accepts, the desk builds one transaction: an Ed25519 verify instruction over the quote, then the program’s settle. The taker signs and sends it. In that one instruction the taker’s leg goes into the maker’s vault, the maker’s leg comes out of the vault to the taker, the 5 bps fee on the quote leg goes to the fee recipient, and the quote is marked used so it can never settle twice. Settlement covers what the program checks.

After settlement

The settled trade is public on chain, like any Solana transfer. The request and the quotes that lost never leave the envelopes: only the taker and each maker can open them, in their own browsers. Privacy lists exactly what each party sees.

Timings

WhatDefaultLimits
Request window60 s15 to 300 s
Quote validity30 snone; each quote carries its own expiry
Recent blockhash a settlement transaction is built onabout 30 sset by Solana

A settlement transaction has to land before its quote expires and before its blockhash does, so accept a quote soon after it opens.