A batch is bonded when it is posted and proven seconds later
Stake covers a batch for as long as its proof takes. The proof is the only thing that releases the bond, and a program checks it.
What is proven
The guest is a Rust program that runs inside the SP1 zkVM. It takes the batch’s input, the state the batch clears against and the result the solver posted, and checks the four conditions. If any one fails, no proof exists.
Conservation
For every token, what orders and liquidity pay in equals what they are paid out, less fees.
Limits
An order fills only at its limit or better, and an order strictly better than the cleared price fills in full.
Liquidity on its curve
Each position ends where its range and the cleared prices put it.
Maximal
No other price vector inside the band fills more volume.
The solver and the guest call the same clearing library, so what the node solves is what the guest checks and what the program settles.
The public values
The proof commits to four values, 104 bytes in all. The program recomputes them from the batch it holds and verifies the proof against them.
batch_idWhich batch this is.
input_hashA running hash of every order placed and cancelled in the window, folded in as each one lands.
state_hashThe last proven prices, the band, the fee and every pair’s liquidity as they stood when the batch cleared.
result_hashThe posted prices, the fill fractions of orders exactly at their limit, and the fees.
- Proof system
- SP1 Groth16
- The proof
- 260bytes
- Verifying it on Solana, in
prove_batch - 180,087compute units
A proof, its public values and the clearing fit in one transaction of 4,096 bytes. Anyone can follow a batch’s proof transaction to an explorer, or run the guest on the batch’s input themselves.
The bond invariant
bond locked ≥ value moved
This holds for every batch between clearing and proof. When a solver posts a clearing, the program measures the value the batch moves at the posted prices and locks that much of the solver’s free bond. A solver with less free bond than the batch moves cannot post it.
The solver cannot shrink the measured value by posting false prices: every price has to sit inside the band around the token’s last proven price, and only a proven batch moves that price. So a false clearing costs its solver at least what it moved, and pays the people in the batch.
The bond is SOL and liquid staking tokens, valued in SOL at each stake pool’s own rate, which the program reads on chain.
The proof window
- Batch window
- 10slots, 2 s
- Proof window
- 300slots, about 60 s
- Unstake cooldown
- one proof window
A stake that backs a batch is exposed for that batch’s proof window. When the proof verifies, the same stake is free to back the next batch, so a solver’s stake secures a new batch each time a proof lands. Unstaking takes one cooldown of the same length, which is the longest any stake can still be standing behind a batch.
When a proof does not land
If no proof verifies before the deadline, anyone can slash the batch. The locked bond moves to the batch’s cover. Orders and positions that had not settled are returned untouched. The cover makes whole anything the batch’s settlements left short, and the rest is paid to the batch’s traders and liquidity providers in proportion to what they had in it.
Each person in a slashed batch claims their share from the batch’s page.