Trigger
An account or isolated position is at risk when:MarginRatio < 1.0, which means Equity < MM.
Cross and isolated positions are checked independently:
- Cross uses the account’s cross equity and combined cross maintenance margin.
- Isolated evaluates each isolated position using its own equity and maintenance margin.
While Liquidating
When liquidation starts, the affected scope is flagged:- Cross liquidation blocks new orders on every market for the account.
- Isolated liquidation blocks new orders only on the affected market.
liquidation: true in the account’s fill history and liq: true on the
WebSocket fills channel.
Execution
The system closes flagged positions with reduce-only immediate-or-cancel orders. These orders execute immediately against available liquidity and cancel any unfilled quantity. Margin health is re-evaluated between orders, so partial fills that restore the account naturally stop the process.Target Selection
Cross liquidation closes one position at a time. After each fill settles, the system re-evaluates and picks again from the remaining cross positions, so a trader with multiple cross positions is unwound across several cycles rather than all at once. Isolated liquidation closes the flagged position in full.Order Shape
Liquidation orders are IOC, reduce-only, and market-priced. They sweep whatever liquidity is resting on the book at the moment they land. There is no protective spread off Mark.Recovery
When a liquidating account’s equity recovers to or above its recovery initial margin, the flag clears and normal order submission resumes. If a position is fully closed during liquidation, the flag is also cleared because the market no longer has a position to liquidate.Insurance-Fund Backstop
If equity falls far enough below maintenance margin that order-book liquidation is unlikely to recover value, the system skips the order book and absorbs the position into the insurance fund.- Cross backstop absorbs all of the trader’s cross positions plus their quote-asset balance into the insurance-fund account.
- Isolated backstop absorbs the specific isolated position and its allocated isolated margin.
Auto-Deleveraging
If a breach is severe enough for the backstop but the insurance fund cannot safely absorb the position, the system force-closes it directly against traders holding the opposite side. This is auto-deleveraging (ADL): no order-book matching, no draw on the insurance fund. An isolated liquidation deleverages the affected market only. A cross liquidation deleverages every open cross position the account holds.Counterparty Selection
For each affected market, opposite-side positions are ranked by:ProfitRatioisMark / Entryfor longs andEntry / Markfor shorts.Notional / Equityis effective leverage: position notional at Mark over cross equity for a cross position, or over the position’s own equity for an isolated position.
Execution Price
- An isolated liquidation deleverages at the liquidated position’s bankruptcy price — the price at which its isolated margin is exactly exhausted.
- A cross liquidation deleverages at the Mark Price frozen when the liquidation started, not the live mark.
What Counterparties See
- The fill arrives on the WebSocket
fillschannel and in trade history withadl: true. Theliqflag marks only the leg whose own position is being liquidated, so it staysfalseon the counterparty leg. - A
position_deleveragednotification reports the market, side, size closed, execution price, and realized PnL.