Overview
The liquidation system protects the protocol and liquidity pool from bad debt by automatically liquidating under-collateralized accounts. Notional implements a tiered liquidation strategy that minimizes trader losses while ensuring system solvency.Protocol Net Exposure
Notional executes all user orders through a single Hyperliquid account. Opposing user positions are netted on Hyperliquid while the protocol maintains an internal ledger of individual positions. Example: If User A is long 10 BTC-PERP and User B is short 8 BTC-PERP, the protocol holds only a net 2 BTC-PERP long position on Hyperliquid. This net-exposure model reduces protocol liquidation risk - evaluated on 2 BTC exposure rather than 18 BTC gross positions. User-level liquidation: Hyperliquid only sees the net position and has no visibility into individual account health. When a user’s Cross Margin Ratio reaches critical levels, Notional executes its own liquidation process.Margin Monitoring
Accounts are continuously monitored for margin adequacy using the Cross Margin Ratio:- MMR (Maintenance Margin Requirement) = sum of (|position size| × mark price / (max leverage × 2)) + margin required for open orders
- Total Margin Value = (collateral × max LTV) + unrealized PnL
Lower ratios indicate healthier accounts. The Cross Margin Ratio represents the percentage of effective collateral being used for maintenance margin.
Liquidation Thresholds
| Cross Margin Ratio | Action |
|---|---|
| < 0.90 | ✅ Healthy - Liquidation complete |
| 0.90 - 1.0 | ✅ Moderate risk |
| ≥ 1.0 | ❌ Partial Liquidation triggered |
| ≥ 1.5 | ❌ Full Liquidation triggered |
Event-Driven Monitoring
The Account Cache refreshes automatically when triggering events occur:- Price Changes: Hyperliquid WebSocket updates trigger recalculation for accounts holding affected assets/positions
- Position Changes: Order fills immediately invalidate cache and trigger recalculation
- Collateral Changes: Deposits and withdrawals trigger recalculation
- Hourly Settlements: Funding payments and interest accrual trigger recalculation
liquidationRequired event.
Two-Tier Liquidation System
Partial Liquidation (Ratio ≥ 1.0)
The protocol liquidates in three sequential phases, checking the Cross Margin Ratio after each step and stopping once it falls below 0.90.Phase 1: Cancel Open Orders
All open orders are canceled to reduce margin requirements. Why this helps:- Canceling orders immediately frees up margin reserved for unfilled orders
- May restore account health without closing positions
- Least destructive action
Phase 2: Close Positions
If margin ratio remains ≥ 0.95 after canceling orders, positions are closed via market orders sent to Hyperliquid’s order book. Execution:- Positions closed sequentially (largest to smallest by USD value)
- Market orders with reduce-only flag
- Each closure recorded as
OrderPlacedevent
Phase 3: Sell Collateral
If closing positions is insufficient to restore margin (due to slippage or realized losses), non-USDC collateral is sold to cover the deficit. Execution:- Sell non-USDC assets (BTC, ETH, HYPE, SOL) sequentially
- Highest to lowest USD value
- Converted to USDC to cover losses
Full Liquidation (Ratio ≥ 1.5)
If partial liquidation fails to restore margin or the Cross Margin Ratio reaches ≥ 1.5 (total margin value falls below 2/3 of maintenance margin), the protocol escalates to full liquidation.TWAP Exit Strategy
The protocol initiates a TWAP-based unwind across every open position and all non-USDC collateral simultaneously. Order Sizing:- Capped as a fraction of each market’s 24-hour volume
- Minimizes market impact
- Optimizes execution quality
- Limit orders priced to cross the bid-ask spread
- Incentivizes market takers to absorb flow
- Provides price improvement over market orders
- All positions and collateral liquidated in parallel
- Faster completion than sequential liquidation
- Reduces exposure to further price movements
Resting Orders and Price Adjustment
Unfilled orders rest on the order book for 30 seconds before prices are progressively adjusted to increase execution probability. This repricing cycle continues until all positions and collateral are fully liquidated.Final Settlement
Once all assets and positions have been unwound:- Liquidation proceeds first cover outstanding liabilities
- Deficit (if any) recorded as bad debt → absorbed by insurance fund
- Surplus (if any) routed to insurance fund until target, then split between insurance fund and protocol
Bad Debt Handling
Despite comprehensive risk management, extreme market conditions may create bad debt (liabilities exceeding collateral after full liquidation).Waterfall Coverage Model
Losses are covered in strict priority order:- Insurance Fund - Covers bad debt up to fund balance (target: 5% of total borrowed USDC)
- LP Pool Haircut - If insurance fund depleted, losses socialized across all liquidity providers pro-rata
The insurance fund is funded by protocol revenue and liquidation surplus (when liquidated collateral exceeds liabilities). Fund balance is published in the transaction log hourly.
Example Liquidation
The following example demonstrates a partial liquidation that resolves after canceling open orders.Initial State (ETH at $3,000)
An account holds:- Collateral: 1 ETH spot = 2,550)
- Position: 10 ETH-PERP long entered at 30,000)
- Open Orders: 4 ETH-PERP limit buy at 10,400)
- MMR: Position MMR = 208 = $808 total
- Total Margin Value: 0 unrealized PnL = $2,550
- Cross Margin Ratio: 2,550 ≈ 0.32 ✅ Healthy
After ETH Drops to $2,900 (No Liquidation)
- Collateral: 1 ETH = 2,465)
- Position PnL: 10 × (3,000) = -$1,000
- MMR: $808 (unchanged)
- Total Margin Value: 1,000) = $1,465
- Cross Margin Ratio: 1,465 ≈ 0.55 ✅ Still healthy (< 1.0)
After ETH Drops to $2,839 (Liquidation Triggered)
- Collateral: 1 ETH = 2,413)
- Position PnL: 10 × (3,000) = -$1,610
- MMR: $808
- Total Margin Value: 1,610) = $803
- Cross Margin Ratio: 803 ≈ 1.006 ❌ LIQUIDATION TRIGGERED
Phase 1: Cancel Open Orders
- ETH limit order (4 ETH-PERP @ $2,600) canceled
- MMR reduced: 208 = $600
- Cross Margin Ratio: 803 ≈ 0.747 ✅ Account restored
- 1 ETH collateral
- 10 ETH-PERP long position
- No bad debt
If ETH Continued Falling to $2,820
This would trigger another liquidation:- Total Margin Value: 1,800) = $597
- Cross Margin Ratio: 597 ≈ 1.005 ❌ Liquidation triggered again
- The 10 ETH-PERP position closed with 5 bps slippage, realizing loss of $1,814
- To cover this loss, 0.644 ETH of collateral sold (also at 5 bps slippage)
- User ends liquidation with no open positions and 0.356 ETH collateral