Trigger condition
An account is liquidatable whenever . Keepers compute health off-chain (using the same formulas asperps-math) and
submit a liquidate tx when it flips negative.
What happens in liquidate
Cancel resting orders
All the victim’s orders are removed; their reserved margin is forfeited
to the insurance vault, not refunded to the victim. This is part of the
penalty for being liquidated with open orders.
Close the full position
The position is closed entirely at oracle price (no slippage).
Realized PnL is computed and applied to the victim’s
collateral.Split the fee
- 50% transferred from
collateral_vaultto the liquidator’s token account. - 50% transferred to the
insurance_vault.
Fee recipient
Liquidators receive the reward in the collateral mint (USDC), transferred to a token account they pass in asliquidator_token_account. Spec:
Why is the position closed fully?
V1 uses whole-position liquidation rather than partial unwinds. Rationale:- Simpler on-chain state, no “partially-liquidated” zombie accounts.
- Faster convergence back to solvency.
- Clearer keeper economics, the fee is computed on the full notional.
Insurance fund
The insurance fund is an SPL token account owned by the market PDA. It fills from:- 50% of every liquidation fee
- Forfeited margin of liquidated users’ resting orders
- Admin-seeded funds (one-time boot)
- Bad debt drains it during a liquidation
- V2 governance votes to redirect some funds (not implemented in V1)
BadDebtDetected and pauses. Admin
intervention is required to re-seed and resume.
Keeper economics
- Reward: 2.5% of closed notional (half the liquidation fee)
- Cost: Solana tx fee + RPC latency race
- Risk: Getting out-raced to the fill by another keeper

