Hyperliquid liquidation price: how it's calculated and how to avoid it

By the Whenly team · · 8 min read

Short answer

Hyperliquid liquidates a position when its margin falls below the maintenance margin, which is half the initial margin at the asset's maximum leverage: 1.25% of the position for BTC, whose maximum is 40x. The liquidation price is price − side × margin_available / position_size / (1 − l × side). An isolated BTC long at 10x is liquidated after a fall of about 8.9%; at 20x, after about 3.8%.

Liquidation is the exchange closing your position because the margin behind it can no longer cover the risk. On Hyperliquid it follows a published formula, so you can work out exactly where it happens before you open a trade. This guide gives the formula, a worked example, the distance to liquidation at each leverage, and what to do to stay away from it.

Hyperliquid liquidation price calculator

Side
Asset's max leverage
Liquidation price$91,1398.86% below entry
Margin
$1,000.00
Maintenance margin (1.25%)
$125.00
Leverage used
10x
For a new isolated position, fees ignored, using Hyperliquid's formula below. Pick the asset's maximum leverage: it sets the maintenance margin (BTC 40x, ETH 25x, SOL 20x, HYPE 10x at the time of writing). In cross margin your whole account stands behind the position, so the real liquidation price is further away; the terminal shows it exactly.

When does Hyperliquid liquidate a position?

When the margin behind it falls below the maintenance margin. For a cross position that means your account value, including unrealized PnL, is below the maintenance margin of all your cross positions; for an isolated position, its own isolated margin is below its maintenance margin.

Per Hyperliquid's liquidation docs, the maintenance margin formula is simple: it is half of the initial margin at the asset's maximum leverage, or 1 / (2 × max leverage) of the position's value. Maximum leverage ranges from 3x to 40x by asset:

Max leverageInitial margin at maxMaintenance marginExamples
40x2.5%1.25%BTC
25x4%2%ETH
20x5%2.5%SOL, XRP
10x10%5%HYPE, DOGE
3x33.3%16.7%Some small and new markets

Maximum leverage can step down for very large positions, and Hyperliquid changes it per asset from time to time; the terminal's leverage control always shows the current maximum.

How to calculate your liquidation price

Hyperliquid publishes the liquidation price formula in its docs:

liq_price = price − side × margin_available / position_size / (1 − l × side)
  • side is 1 for a long and −1 for a short.
  • l is the maintenance margin rate (1 / maintenance leverage): 0.0125 for BTC.
  • margin_available is, for isolated, the isolated margin minus the maintenance margin required; for cross, the account value minus the maintenance margin required.
  • price is the current mark price and position_size the size in coins.

A worked example: BTC at 10x

Take an isolated BTC long of 0.1 BTC at a round $100,000 (a $10,000 position) with 10x leverage. BTC's maximum is 40x, so the maintenance margin rate is 1.25%.

margin            = $10,000 / 10            = $1,000.00
maintenance       = $10,000 × 1.25%         = $125.00
margin_available  = $1,000.00 − $125.00     = $875.00
liq_price (long)  = $100,000 − $875.00 / 0.1 / (1 − 0.0125)
                  = $91,139.24 (8.86% below entry)

The same position as a short is liquidated at $108,641.98, 8.64% above entry: slightly closer, because the divisor is 1 + l instead of 1 − l. Fees, funding and later price moves change the real number a little; the terminal shows the exact Liq. Price for your position.

Distance to liquidation by leverage

How far BTC can move against an isolated position, just opened, before liquidation (maintenance margin 1.25%, fees ignored). Doubling the leverage roughly halves the distance.
LeverageLong: liquidated after a fall ofShort: after a rise of
2x49.37%48.15%
3x32.49%31.69%
5x18.99%18.52%
10x8.86%8.64%
20x3.8%3.7%
25x2.78%2.72%
40x1.27%1.23%

At 40x, BTC's maximum, a move of about 1.3% liquidates the position: an ordinary hour for BTC. The rule of thumb "liquidation ≈ 1 / leverage" overstates the room you have, because the maintenance margin is taken off first.

Cross margin vs isolated margin

CrossIsolated
Margin behind the positionYour whole cross accountOnly what you assigned to it
Liquidation priceMoves with every other cross position and your balanceFixed unless you add or remove margin
If it is liquidatedCan take your other cross positions with itLoses only its own margin
Unrealized profitUsable as margin for new positionsStays with that position

Cross is Hyperliquid's default and is more forgiving for one position, because the whole account stands behind it. Isolated limits the damage of one bad trade. Some HIP-3 markets trade isolated only, for example Palantir on the xyz dex, and the io dex's Nvidia, Apple and Circle are strict isolated, where margin can't be removed until the position closes. Stock perps on Whenly's Stocks page show each market's mode. How margin is shared between spot and perps also depends on your account mode.

What happens during a liquidation

  1. Hyperliquid sends market orders to close the position on the order book, using the mark price to decide. If the account gets back above the maintenance margin, the remaining collateral stays yours.
  2. Positions larger than 100,000 USDC are liquidated 20% at a time, with a 30-second cooldown between steps.
  3. If equity falls below two thirds of the maintenance margin without the book absorbing the position, the liquidator vault takes it over (a backstop liquidation), and the maintenance margin is not returned.

Hyperliquid charges no separate clearance fee on liquidations, unlike most centralized exchanges.

Five ways to avoid liquidation

  1. Use less leverage than the maximum. The table above is the whole argument: 5x gives BTC about 19% of room, 20x about 3.8%.
  2. Set a stop loss well inside the liquidation price, so you choose the exit and keep the rest of the margin. See stop loss and take profit on Hyperliquid.
  3. Add margin to an isolated position that is getting close, if you still want the trade.
  4. Watch funding on long holds. Paying a high rate for days drains margin; see funding rates explained.
  5. Automate the rescue. The Liquidation Guard template watches every position: when one gets within 15% of liquidation it adds up to $200 of margin, then cuts the position by 30% if it's still too close. It runs on Whenly's servers, so it acts at 3 a.m. too. More in how to automate Hyperliquid trading.

Liquidation risk is highest when markets move fastest, which is also when data and orders are slowest. Treat any buffer, manual or automated, as a minimum.

Frequently asked questions

What is the maintenance margin on Hyperliquid?

Half of the initial margin at the asset's maximum leverage. For BTC, with a 40x maximum, initial margin at 40x is 2.5% and the maintenance margin is 1.25% of the position's value. For an asset with a 10x maximum it is 5%.

Does Hyperliquid charge a liquidation fee?

Hyperliquid charges no clearance fee on liquidations. If the order book liquidation fails and the backstop liquidator vault takes the position over, the maintenance margin is not returned.

Which price does Hyperliquid use for liquidations?

The mark price, which combines prices from other exchanges with Hyperliquid's order book. The last traded price on Hyperliquid alone doesn't liquidate you.

How do I calculate my liquidation price on Hyperliquid?

Use liq_price = price − side × margin_available / position_size / (1 − l × side), where l is the maintenance margin rate (half of 1 / max leverage). For a new isolated position that reduces to a distance of (1/leverage − l) / (1 − l) for a long. The calculator in this article does the arithmetic.

What is the difference between cross margin and isolated margin?

Cross margin backs every cross position with your whole account balance, so one position can draw on the rest but a liquidation can take the others with it. Isolated margin backs a position only with the margin you assign to it, so its liquidation loses only that margin.

Is my liquidation price fixed?

In isolated margin it moves only if you add or remove margin or change the position. In cross margin it moves with your whole account: profits on other positions push it away, losses and new positions pull it closer.

This article explains how things work; it is not investment advice. Perpetual futures carry a high risk of loss. Read the Risk Disclosure.