Compute units, measured.
Every number on this page is measured, not estimated. We ran each book's mainnet program on the same local validator with its own client, tested liquidation on the compiled program, and averaged live devnet transactions you can check in the explorer.
Live on devnet
Per-instruction compute units of recent AxioPerp transactions on devnet, read from the program logs, including the keeper's.
| Action | Count | Mean | Median | p95 | Max |
|---|
Against other on-chain order books
One transaction per action. AxioPerp includes its margin check and event log; the others are spot books with neither.
Market order as it fills more
One market order fills N resting orders of 10 lots each, either at N different prices or all at one price.
N orders at N prices
N orders at one price
Fails at N: the smallest N one market order cannot fill. OpenBook v2 stops matching after 255 orders, and at one price runs out of memory at 212. Phoenix v1 and Manifest run out of the 1.4M compute limit; Phoenix v1 was measured on its largest market, 4,096 orders a side. AxioPerp's market order is O(log N): it never fails.
Liquidation
On the compiled program in LiteSVM. One instruction does it all: withdraws the account's orders, sweeps the book, deleverages the rest and settles any shortfall.
Typical
Worst case
AxioPerp's own worst case, built to cost as much as the program allows:
- the account has the maximum 32 open orders in the market, and all of them must be unwound: fully filled orders are claimed, partly filled ones claimed and cancelled, untouched ones cancelled, spread over every page the transaction passes;
- it holds positions in the maximum 8 markets, so health reads eight marks;
- the sweep crosses 31 prices of 8 orders each, over ground earlier sweeps cleared and makers refilled;
- it either halts inside a queue, or stops at bankruptcy and deleverages the rest; or there is no sweep, and the shortfall is charged.
| Open orders | Markets | Sweep | Compute units |
|---|
The worst case is CU, within one transaction's 1.4M limit. Most of it is unwinding the 32 orders; without open orders the same liquidation takes 20,773–22,470 CU.
Method
- Rival books: OpenBook v2, Phoenix v1 and Manifest programs dumped from mainnet, run on the same
solana-test-validator, each driven by its own client. Ranges are over the price and queue position of the order. - Liquidation: the AxioPerp program as deployed, in LiteSVM 0.18.
- Live devnet: the consumption each AxioPerp instruction logs, over the market's recent transactions.