Liquidations

A liquidation event occurs when a trader's account equity falls below the maintenance margin due to adverse price movements. The maintenance margin equals position value times mainMarginRate.

Liquidation Process Flow

Initial Liquidation Attempt:

  • When account equity < maintenance margin, the system sends market orders to close the full position size.

  • If partially/fully closed, restoring margin above requirements, the remaining collateral stays with the trader.

Backstop Liquidation Trigger:

  • Activates if account equity drops below 2/3 of the maintenance margin after a failed book liquidation.

  • Positions transfer to the SoDEX Vault and Liquidator Strategy Account.

Margin Handling in Backstop:

  • Cross positions: All cross positions and margin transfer to the liquidator; account equity resets to zero if no isolated positions exist.

  • Isolated positions: Only the affected isolated position and its margin transfer; cross assets remain untouched.

  • Maintenance margin is not returned to users, as it provides the vault's profitability buffer.

Price Mechanism

Liquidations use the mark price (synthesizing external CEX prices and SoDEX book state) for robustness. During high volatility, the mark price may diverge significantly from book prices.

For Cross Margin

  • Maintenance Margin = Quantity (contracts) × Contract Face Value per Contract × Entry Price × Maintenance Margin Rate

For Isolated Margin

  • Liquidation Price = (Entry Value + Side × (Maintenance Margin - Isolated Margin)) / (Position Size × Contract Face Value)

  • Maintenance Margin = Position Size × Contract Face Value × Entry Price × Maintenance Margin Rate

Mark Price is calculated in real-time by using the Black-Scholes model. The implied volatility used to calculate Options Mark Price is derived from the best bid and best ask price for the Options contract, along with the volatility cap and volatility floor set in the system. Implied Volatility = {max[min(implied volatility of best bid, volatility cap), volatility floor] + max[min(implied volatility of best ask, volatility cap), volatility floor]} * 0.5The volatility cap and volatility floor might be adjusted without notification during severe market volatility. Mark price provides an unbiased, robust estimate of the fair price of perpetual contracts (perp). It is utilized for:

  • Calculating margin requirements (margining)

  • Triggering liquidation events (liquidations)

  • Activating Take Profit and Stop Loss orders (TP/SL)

  • Determining unrealized profit and loss (unrealized PnL).

The mark price updates whenever validators submit new oracle price updates. Consequently, both mark and oracle prices refresh approximately every 3 seconds.

Last updated