Open the app

Atomic settlement

Taking an offer moves the units, the cash and the fee in one instruction. If any leg can't move, none does.

take_offer is delivery versus payment in one Solana instruction. The units go from seller to buyer, the cash from buyer to seller, and the taker's settlement fee to the fee recipient, all before the instruction returns. A Solana transaction applies every change or none, so a trade can't be half settled.

40 units HALDEN31
take_offerone instruction · slot 312,004,118
41,212.00 USD

Fee 8.24 USD (2 bps, paid by the taker) to the fee recipient

The buyer takes a sell offer at 1,030.30 USD per unit. Units and cash cross in the same instruction; the offer's open size falls by 40.Example
Units one way, cash the other, in one instruction.

The legs

Take 40 units from an ask at 25.50 USD, with the fee at 2 bps. The cash leg is 40 × 25,500,000 = 1,020,000,000 atoms (1,020.00 USD) and the fee is 204,000 atoms (0.204 USD).

LegFromToAmount
Unitsmaker, lockedtaker, free40 units
Cashtaker, freemaker, free1,020.00 USD
Feetaker, freefee recipient's USDC account0.204 USD

Taking a bid runs the other way: the taker's free units go to the maker's free lane, the maker's locked cash goes to the taker, and the taker receives the cash leg less the fee.

TakerPaysReceives
Buys (takes an ask)cash leg + fee, from free cashthe units, free
Sells (takes a bid)the units, from freecash leg − fee, free

The fee is floor(cash leg × fee_bps / 10,000), paid by the taker on every fill. It leaves the vault for the fee recipient's USDC account in the same instruction. See Fees and the AGORA token.

What has to hold

The program checks every leg before it moves any of them. Any one of these fails the whole transaction:

CheckError
The taker is admittedNotAdmitted
The taker isn't the makerSelfTrade
Units are 1 to the offer's open sizeZeroAmount, OfferTooSmall
A buying taker has the cash leg plus the fee, freeInsufficientFreeCash
A selling taker has the units, freeInsufficientFreeUnits
The maker's lock covers the fillInsufficientLockedUnits, InsufficientLockedCash
The fee account is the fee recipient's USDC accountInvalidFeeAccount

Because the maker's side was locked when the offer was posted (Immediate execution), the lock check holds for every offer the program created.

After the fill

  • The offer's open size falls by the units filled; at zero the offer closes and its rent goes back to the maker.
  • The instrument's last price becomes the offer's price.
  • Both parties' unit positions settle their income first, so income paid before the trade stays with the seller.

The settlement record

Every instruction emits one event that lists each balance it moved as a leg: owner, asset, lane, amount and direction. The indexer stores it as a settlement with the transaction's signature, slot and block time, and the ledger shows it the moment it lands. A take is the kind trade.

KindInstructionWhat settled
admissionadmitA wallet was admitted.
depositdepositUSDC deposited into free ledger cash.
withdrawwithdrawFree ledger cash withdrawn as USDC.
listlist_instrumentAn instrument was listed.
issueissueUnits were issued to a member.
post-offerpost_offerAn offer was posted and its side locked.
cancel-offercancel_offerAn offer was cancelled and its lock released.
tradetake_offerAn offer was filled, in part or in full.
post-repo-offerpost_repo_offerA repo offer was posted and its cash locked.
cancel-repo-offercancel_repo_offerA repo offer was cancelled and its cash released.
repo-opentake_repo_offerA repo opened: units pledged, cash advanced.
repo-repayrepay_repoA repo was repaid and its pledge released.
defaultsettle_defaultA matured repo's pledged units went to the lender.
incomepay_incomeAn issuer paid income into an instrument.
claimclaim_incomeA holder claimed income into free cash.

At any hour

The program has no session and no calendar: every instruction runs in whichever slot it lands in, at any hour of any day.

00061218

··:··UTC now

  • Agora ledger 00:00 to 24:00 UTC, every day
  • NYSE regular session 14:30 to 21:00 UTC on weekdays, while New York is on standard time
24 hours in UTC; the ledger settles in every one.

Both legs settle on this ledger, against ledger cash. Settling against cash held on another chain is the road build "Cash on another chain", and choosing a later settlement time is "Settlement at a chosen time".