Liquidations

Margin Trade enforces transparent, onchain liquidation and auto-deleveraging mechanisms to ensure the solvency of the system under all market conditions.

Liquidations occur when a trader’s account equity (collateral + unrealized PnL) falls below the required maintenance margin.

All liquidation and deleveraging logic is executed directly on-chain within the Margin Trade clearing layer, ensuring deterministic, transparent, and verifiable outcomes.


Overview

When market prices move against a trader’s open positions, unrealized losses reduce their account equity.

If equity drops below the maintenance margin threshold, the system will begin full liquidation of the affected positions.

  • Margin Trade uses full liquidations. Once triggered, the entire open position is closed automatically at the current mark price through onchain market orders. There are no partial liquidations or backstop vaults.

  • Cross margin accounts: Since all Margin Trade accounts currently use cross margin, liquidation affects the account’s entire trading balance. All open positions share the same margin pool and will be closed together if total equity falls below the maintenance level.


Liquidation Process

  1. Trigger Condition When

    account_equity < maintenance_margin_required

    liquidation is triggered for all open positions.

  2. Market Liquidation Orders The clearing engine submits onchain market orders to close the position(s) in full. These execute against the resting order book using mark price for fair value validation.

  3. Execution and Settlement

    • Liquidations are processed atomically within the same block.

    • Orders are matched by price-time priority, just like normal trades.

    • All collateral above maintenance margin is returned to the trader after settlement.

    • Any remaining unrealized loss is absorbed by the liquidation process.

  4. Post-Liquidation Account State

    • The trader’s positions are reset to zero.

    • If the liquidation successfully covers all losses, the remaining balance (if any) remains available for withdrawal or new trades.

    • If not, the system triggers Auto-Deleveraging (ADL) to ensure no bad debt remains.


Mark Price in Liquidations

Liquidations are based on the mark price, not the last traded price. The mark price combines external exchange data (oracle) and onchain order book data (Margin Trade) to produce a robust fair value estimate.

This prevents unnecessary liquidations due to short-term volatility or thin order book conditions. See Price Feeds for a detailed explanation of the mark price calculation.


Computing Liquidation Price

An estimated liquidation price is shown in the interface for each open position. This estimate adjusts dynamically with unrealized PnL, funding payments, and other open positions (in cross margin).

The general conceptual formula is:

liq_price = entry_price - side * margin_available / position_size / (1 - (1 / maintenance_leverage) * side)

Where:

  • side = 1 for longs, -1 for shorts

  • margin_available = account_equity - maintenance_margin_required

  • maintenance_leverage = 1 / maintenance_margin_rate

This formula reflects the point at which total account equity equals the maintenance requirement. Because Margin Trade uses cross margin, liquidation price depends on your total account equity, not only on individual position margin.


Maintenance Margin and Liquidation Thresholds

The maintenance margin rate is approximately half of the initial margin rate at max leverage. Typical values:

Asset
Max Leverage
Maintenance Margin

BTC-USDC

40×

1.25 %

ETH-USDC

30×

1.67 %

SOL-USDC

20×

2.5 %

NVDA-USDC

10×

5.0 %

XAU-USDC (Gold)

10×

5.0 %

If the account equity falls below this margin level, liquidation begins immediately and proceeds until all open positions are fully closed.

Best Practices for Traders

  • Monitor your margin ratio frequently in the account panel.

  • Avoid over-leveraging; higher leverage reduces your liquidation buffer.

  • Use stop losses to proactively exit before liquidation.

  • Keep extra USDC collateral in your account to maintain a safe margin ratio during volatility.

Last updated