For the complete documentation index, see llms.txt. This page is also available as Markdown.

Liquidations

Liquidations protect the Nexus Exchange from insolvency by ensuring traders maintain sufficient margin to support their open positions.

When an account's equity falls below its required maintenance margin, the exchange's liquidation engine automatically closes positions at the current mark price, preventing negative balances and preserving system-wide solvency.

Mark price and equity

The exchange uses a mark price derived from the oracle (see Price Oracles). Account equity is:

equity = collateral + unrealized_pnl(mark_price)

Margin requirements

Margin follows the same rules as Margining — notional valued at the mark price, scaled by each market's configured rates:

initial_margin     = position_size × mark_price × initial_margin_rate
maintenance_margin = position_size × mark_price × maintenance_margin_rate

Liquidation trigger

A position becomes eligible for liquidation when account equity falls below the total maintenance margin across all positions:

liquidatable when:  equity < Σ maintenance_margin

Liquidation process

  1. Trigger — equity falls below maintenance margin.

  2. Execution — a dedicated on-chain liquidator sub-account closes the position at or near the mark price.

  3. Bankruptcy protection — a price cap prevents negative balances.

  4. Insurance fund — covers any remaining shortfall if a position cannot be closed in time.

Last updated