chordDocs

Getting started

How a batch works

Collect, solve, commit, settle: the life of one batch, slot by slot.

Every batch runs the same sequence. Its boundaries are Solana slots written into the batch account when it opens, so anyone can see exactly when each phase starts and ends.

#The five steps

#Collect

The collector opens a batch and takes signed orders until the collection window closes. An order is a signature over what you sell, what you buy, how much, the least you’ll accept, a nonce, and the batch it belongs to. Orders sit in your wallet the whole time; nothing moves yet.

#Solve

When collection closes, solvers read the batch and submit quotes. A quote is one price for the pair plus the fills it implies, signed by the solver. The collector validates every quote and picks the one that leaves traders the most surplus. See Clearing and selection.

#Commit

The winning price goes on chain in a transaction signed by both the collector and the winning solver. In that same transaction the solver deposits reserves that cover every output the quote owes, and one bond is locked against the batch. From here the price cannot change.

#Settle

The collector submits one fill per order. Each fill verifies your signature on chain, then moves your input into the batch vault and your output to you in the same instruction. A batch can take as many transactions as it needs, because every output was escrowed at commit.

#Finish or slash

When every committed fill has landed, the batch completes: the bond unlocks and leftover reserves return to the solver. If the settlement window ends first, the bond is slashed to the treasury, the reserves still go back to the solver, and any order that wasn’t filled stays in its owner’s wallet.

#Timing

Governance sets each market’s window lengths in slots. These are the standard values; the app reads the live ones from the collector and shows the countdown on the stage.

PhaseSlotsAbout
Collect9638 seconds
Solve6426 seconds
Settleup to 5123.4 minutes

Slots average around 400 ms, so these are approximate. Most batches commit within seconds of the solve window closing, and fills follow immediately.

#Batch statuses

These are the names the app uses on the stage and in recent batches.

StatusMeaning
OpeningThe batch account is being created on chain.
CollectingTaking orders.
SolvingCollection closed; solvers are quoting.
CommittingA winner was chosen and its commit transaction is on its way.
SettlingThe price is on chain and fills are landing.
SettledEvery committed fill landed. The bond is released.
Solver defaultedThe winning solver didn’t finish in time and its bond was slashed.
ExpiredNo quote committed before the deadline. Nothing was filled and nobody is slashed.
Not openedThe batch account didn’t land before its window closed, so it never took orders.

#Why the price can’t move under you

Fills read the price from the batch account, and the program accepts a fill only while the batch is committed and the settlement window is open. There is no instruction that changes a committed price, and the solver’s reserves can’t be withdrawn while the batch is active.