Skip to main content

Liquidations

HIP-3 deployed perpetuals inherit Hyperliquid's core liquidation system.

Overview

A liquidation event occurs when a trader's positions move against them to the point where the account equity falls below the maintenance margin. The maintenance margin is half of the initial margin at max leverage.

When the account equity drops below maintenance margin, the positions are attempted to be entirely closed by sending market orders to the book. The orders are for the full size of the position, and may be fully or partially closed. If the positions are entirely or partially closed such that the maintenance margin requirements are met, any remaining collateral remains with the trader.

Liquidations use the mark price, which combines external CEX prices with Hyperliquid's book state. This makes liquidations more robust than using a single instantaneous book price. During times of high volatility or on highly leveraged positions, mark price may be significantly different from book price.

Partial Liquidations

For liquidatable positions larger than 100k USDC (10k USDC on testnet for easier testing), only 20% of the position will be sent as a market liquidation order to the book. After a block where any position of a user is partially liquidated, there is a cooldown period of 30 seconds. During this cooldown period, all market liquidation orders for that user will be for the entire position.

Computing Liquidation Price

When entering a trade, an estimated liquidation price is shown. This estimation may be inaccurate compared to the position's estimated liquidation price due to changing liquidity on the book.

The liquidation price does depend on leverage set for isolated margin positions, because the amount of isolated margin allocated depends on the initial margin set.

When there is insufficient margin to make the trade, the liquidation price estimate assumes that the account is topped up to the initial margin requirement.

The precise formula for the liquidation price of a position is:

liq_price = price - side * margin_available / position_size / (1 - l * side)

Where:

  • l = 1 / MAINTENANCE_LEVERAGE - For assets with margin tiers, maintenance leverage depends on the unique margin tier corresponding to the position value at the liquidation price
  • side = 1 for long and -1 for short
  • margin_available (isolated) = isolated_margin - maintenance_margin_required

For more details, see: Hyperliquid Trading Liquidations