Skip to content
Request a review

Hyperliquid Architecture · HyperCore & HyperEVM · 6/8

Hyperliquid Margin and Liquidations: How the Liquidation Engine Works

In short: Hyperliquid liquidates when account value falls below maintenance margin (half the initial margin at the asset's maximum leverage), measured with the mark price. The engine first tries to close the position with market orders on the book; if that has not succeeded and account value falls below 2/3 of maintenance margin, the liquidator vault inside HLP takes it over; and if an account goes negative, auto-deleveraging (ADL) closes it against profitable traders.

Margin System

Hyperliquid uses cross margin by default, where your cross positions share the same collateral pool. You can also use isolated margin for individual positions.

Cross Margin

Account Value     = Collateral + Unrealized PnL (all cross positions)
Initial Margin    = Sum of (Position Notional / Leverage)
Maintenance Margin = Sum of (Position Notional * Maintenance Margin Rate)
Liquidation when Account Value < Maintenance Margin

With cross margin, profits from one position can offset losses in another. This is capital-efficient but means a single bad position can affect your entire cross account.

Isolated Margin

Each position has its own dedicated margin. If one isolated position gets liquidated, it doesn't affect others. The trade-off is lower capital efficiency.

Leverage

Maximum leverage varies by asset based on liquidity. As of October 2026, the live meta endpoint of the info API showed:

Asset Max Leverage
BTC 40x
ETH 25x
SOL 20x
HYPE 10x
Most altcoins 3-10x

Larger positions fall into margin tiers with lower maximum leverage. HIP-3 markets set their own limits.

Liquidation Mechanics

The maintenance margin rate is half of the initial margin at the asset's maximum leverage (for example, 1.25% for a 40x asset). When account value falls below maintenance margin:

  1. Liquidation Trigger — Account value (or isolated margin plus PnL) falls below maintenance margin, measured with the mark price
  2. Liquidation on the Book — The engine sends market orders to the order book to close the position. For positions above 100k USDC, only 20% is sent at first, followed by a 30-second cooldown. Any collateral left after closing stays with the trader
  3. Backstop Liquidation — If account value falls below 2/3 of maintenance margin without a successful book liquidation, the liquidator vault (part of the community-owned HLP vault) takes over the positions and the remaining margin
  4. ADL (Auto-Deleveraging) — If an account's value goes negative, profitable traders on the opposite side are ranked by profit and leverage, and their positions are closed against the underwater account. This guarantees the platform carries no bad debt

There is no separate insurance fund; the liquidator vault and ADL play that role.

Liquidation Price (Isolated Long, Simplified)

Ignoring funding and fees:

Liquidation Price = Entry Price * (1 - 1/leverage) / (1 - maintenance_rate)

For a 10x isolated long at $100 entry on an asset with 2.5% maintenance margin (20x max leverage):

Liq Price = 100 * (1 - 0.1) / (1 - 0.025) ≈ $92.31

For cross positions, the liquidation price depends on the whole account, not the leverage you set. See the liquidation docs for the exact formula.

Liquidation in Code

rdk-liquidation is a Rust crate that classifies an account's margin health from the mark price and closes positions that fall below maintenance margin, with ADL as the last step. It is a simpler model than Hyperliquid's: it closes the whole position at once and sends the liquidation fee and any deficit through an insurance fund, where Hyperliquid sends only 20% of a large position to the book at first and uses the liquidator vault in HLP instead of an insurance fund. Reading where the two differ is a good way to check you understand each step above.

Oracle System

Hyperliquid uses a validator-published oracle. Every 3 seconds, each validator computes a spot price as a weighted median of several centralized exchanges (and Hyperliquid spot, where relevant), and the final oracle price is the stake-weighted median of all validators' submissions. The oracle price is used for: