Protocol

The bond invariant

Bond locked is at least the value moved, for every batch between its clearing and its proof.

Orders settle as soon as a batch is cleared, before its proof exists. What stands behind them for those seconds is the solver's bond, and one rule governs it:

Text
bond locked >= value moved

It holds for every batch from the moment it is cleared until its proof verifies or it is slashed.

Value moved

The program computes the value itself when a clearing is posted, in lamports, from the posted prices:

Text
value_moved = sum over batch tokens of  ceil(offered * price / 2^64)
            + sum over batch pairs of   ceil(paid_out * price(out) / 2^64)
offeredu64
The total of all order amounts selling the token in this batch. The batch keeps it as a running total as orders are placed, cancelled and rolled in.
paid_outu64
What the pair's liquidity pays out in moving to the cleared price.
priceQ64.64
The posted price of the token, in lamports per atom.

offered counts every order in full, filled or not. It is an upper bound on what the orders can move, so the program needs no list of fills to compute it and the bond is never short of the true figure.

Locking

clear_batch locks value_moved lamports of the solver's free bond. Free bond is the solver's stake valued in lamports, less bond already locked behind other batches and less stake in cooldown. A solver whose free bond is smaller is refused with InsufficientBond, and another solver with enough can clear the batch. prove_batch releases the lock.

Bond is counted in SOL. A liquid staking token in a solver's stake is valued at its stake pool's own exchange rate, read from the pool's account on chain.

Why the prices cannot shrink it

The value is measured at the prices the solver posts, so a solver would gain by posting low ones. The band bounds that: every posted price is within band_bps of the token's last proven price, and last proven prices change only when a proof verifies. The measured value of a batch is therefore within the band of its value at proven prices.

Together the two bounds say what a false clearing costs. A solver that posts a clearing no proof can cover has locked at least the value that clearing moved, measured at prices it could not choose freely, and it loses that bond when the proof window ends.

When the proof does not land

After the proof deadline, anyone sends slash_batch. The locked bond moves out of the solver's vaults into the batch's cover. An order of the batch that was not yet settled gets its whole sell amount back when it is settled. The owners of the batch's orders and of the positions on its pairs claim the cover. Slashing and cover has the shares and the claim.

How much one stake carries

Bond is locked only for a proof window. When a proof verifies, the same stake backs another batch.

For a solver with stake S, a proof window of W and batches that each move V:

QuantityValue
Batches it can have cleared and unproven at onceS / V
Value it can clear per unit timeS / W

The default proof window is 300 slots and a batch window is 10 slots. A solver that used the whole proof window for every proof would need bond for every batch cleared in that time. A solver that proves within one batch window needs bond for one batch. Proving time sets how much volume a stake carries.

For a staker, this is the length of the exposure: a stake that backs a batch is locked behind it from Clear to Prove, and free again after. Unstaking and the cooldown follows from it.