Liquidation and ADL policy
The written policy for margin, liquidation, insurance and auto-deleveraging. The contract enforces each rule; the operator acts only inside the limits below.
Margin
- Max leverage is set per market between 2x and 50x. Initial requirement = notional / max leverage. Maintenance = half of initial.
- After each batch, every account that added risk must be above its initial requirement at the mark. An account that only reduced is never blocked.
- Marks used for settlement margin must be under 1 hour old, otherwise the market's last fill price is used. Liquidations, and withdrawals with open positions, need a mark under 15 minutes old.
Liquidation
- Anyone may call
liquidate(account)when the account's equity is under its maintenance requirement at a fresh mark. - The liquidator takes over every position of the account at the mark, and must stay above its own initial requirement afterwards.
- Penalty = half of the maintenance requirement, capped by what equity is left. Half goes to the liquidator, half to the market's insurance buffer.
Insurance and bad debt
Each market has an insurance buffer, fed by 20% of its fees and half of each liquidation penalty. If an account's equity is negative after liquidation, the buffers of the account's markets cover it. What they cannot cover is recorded as bad debt on the market.
Auto-deleveraging
ADL is the last resort. It is allowed only while a market has bad debt and an empty insurance buffer. The operator takes the bad debt out of the open profit of winning positions in that market, at a fresh mark, never more than a position's profit and never more than the debt. The engine ranks winners by profit and leverage, largest first, and calls deleverage(winner, id, amount) in that order until the debt is gone.