How it works
Two order types, mirror images of each other.
Order types
An ask is a resting sell. The seller escrows tokens and names a price in USDC or SOL. Buyers take from it until it is empty.
A bid is a resting buy. The buyer escrows USDC or SOL and names a price. Sellers fill it with tokens until the escrow is spent.
Either side can be filled partially. A 1,000,000 token ask can be taken by fifty different buyers in fifty different transactions, and the order simply counts down.
Settlement
Seller Escrow vault Buyer
│ │ │
│─── create ask ──────────▶│ │
│ tokens locked │ │
│ │◀──── pays the value ───────│
│◀── 99.85% of the value ──│ │
│ │─── 99.85% of tokens ──────▶│
│ │ │
│ 0.15% + 0.15% to the protocol treasury │The escrow vault is a program-derived address unique to that order. It has no private key. Only two code paths can move what is inside it: a fill, which pays the owner and delivers to the counterparty in the same transaction, and a cancel, which returns everything to the owner.
Where the fee comes out
The protocol takes 0.30% in total at the current rate, split as 0.15% from each side and charged on what that side receives. The seller is paid 99.85% of the value in USDC or SOL, the buyer is delivered 99.85% of the tokens, and both halves land in the protocol treasury inside the same transaction. The rate itself is a config field, so the program's own feeBps is the source of truth. Because half of the fee is taken in the traded token, the treasury holds balances in every token that has ever traded.
Quote helpers already account for this. The price bound you sign is compared against the price per token received after fees, never against the headline price on the order.