HyperLiquid’s liquidation system protects the exchange from bad debt through a multi-layered approach: partial liquidation to minimize market impact, a backstop system as a safety net, and rate limiting to prevent cascading failures.Documentation Index
Fetch the complete documentation index at: https://hypernode-docs.polynode.dev/llms.txt
Use this file to discover all available pages before exploring further.
Liquidation triggers
Liquidation occurs when a position’s margin falls below the maintenance margin requirement. The mark price (derived from the oracle system) is used for liquidation checks, not the last traded price. Key factors:- Initial margin = position_size × mark_price / leverage
- Maintenance margin = approximately half of initial margin at maximum leverage
- Positions with the highest effective leverage are liquidated first
Partial liquidation
Rather than closing an entire position at once, HyperLiquid preferentially uses partial liquidation to reduce positions incrementally. Apartial_liquidation_cooldown prevents rapid repeated partial liquidations from destabilizing a position or cascading through the market. This cooldown is enforced at the protocol level within the application state.
Allowed liquidators
The protocol maintains anallowed_liquidators set — addresses specifically authorized to execute liquidations. This is stored at the exchange state level alongside the order books.
Liquidators receive an incentive for executing liquidations, compensating them for the risk and capital required to absorb liquidated positions.
TWAP liquidation
For large positions, liquidation can execute through TWAP (Time-Weighted Average Price) orders to minimize market impact:- The liquidation is split into time-weighted slices
- Each slice has a
size_incrementcontrolling the amount per window - Orders carry standard book order properties (timestamp, size, reduce-only, time-in-force)
- The TWAP window updates track cumulative progress
Backstop liquidation
When standard liquidation mechanisms are insufficient, a backstop system provides a safety net:VoteGlobalAction::SetHip3BackstopLiquidatorParams.
Liquidation in the execution pipeline
Liquidation processing runs as a periodic background task within a fixed execution sequence:- Funding rate changes (which affect margin levels) are applied first
- HIP-3 oracle prices are refreshed
- Then liquidation checks run with up-to-date margin calculations
Lending (BOLE) liquidation
The borrow/lend system has its own three-tier liquidation system (documented in detail on the Lending page):| Mode | Description |
|---|---|
| Market liquidation | Immediate market-order liquidation |
| Backstop liquidation | Safety net via designated liquidators |
| Partial liquidation | Incremental position reduction |
Safety mechanisms
Several protocol-level guards prevent liquidation cascades:| Guard | Purpose |
|---|---|
partial_liquidation_cooldown | Minimum time between partial liquidations |
max_order_distance_from_anchor | Prevents liquidation orders at extreme prices |
cancel_aggressive_orders_at_open_interest_cap_guard | Auto-cancels aggressive orders near OI cap |
post_only_until_time | Can enforce post-only mode during volatile periods |