Liquidation price formula, with worked examples
The liquidation price formula for perpetual futures, its inputs in isolated and cross margin, and worked long, short and cross examples you can recompute.
On this page
The liquidation price is the mark price at which a position's remaining margin equals its maintenance margin, and it follows from four inputs: entry price, position size, the margin backing the position and the maintenance margin rate. This guide writes the formula out as Hyperliquid publishes it, shows what changes between isolated and cross margin, and works through a long, a short and a cross example step by step.
The formula
Hyperliquid documents the exact liquidation price of a position as:1
liq_price = price - side * margin_available / position_size / (1 - l * side)with these inputs:
sideis 1 for a long and -1 for a short.l = 1 / MAINTENANCE_LEVERAGE, which is the maintenance margin rate. On Hyperliquid it is half of the initial margin rate at the asset's maximum leverage, so an asset with 40x maximum leverage has a maintenance leverage of 80 andlof 1.25%.2margin_availableis the margin above the maintenance requirement:account_value - maintenance_margin_requiredfor cross margin,isolated_margin - maintenance_margin_requiredfor isolated margin.1position_sizeis the size in coins, not in dollars.
The denominator (1 - l * side) is there because the maintenance margin itself shrinks or grows with the price. As a long loses value, its notional falls and so does the margin it must keep, which pushes the liquidation price a little lower than a naive "margin divided by size" calculation would give.
A simpler form for isolated positions
For an isolated position without margin tiers, the formula can be rearranged into one line per side. With entry price E, isolated margin M and size s:
long: liq = (E - M / s) / (1 - l)
short: liq = (E + M / s) / (1 + l)Because the isolated margin at opening is the notional divided by the leverage, M / s equals E / leverage. A long at leverage L is therefore liquidated at E × (1 - 1/L) / (1 - l). That is the whole reason leverage matters for isolated positions: it sets how much margin is allocated.
Cross margin: the account is the margin
In cross margin, the margin behind a position is the whole account value, including the unrealised profit or loss of every other cross position. Two consequences follow directly from the inputs:
- The leverage setting does not change the liquidation price. Hyperliquid's docs say so explicitly: a cross position at lower leverage simply uses more collateral.1 What matters is how much equity the account holds.
- Other positions move it. If another cross position loses, the account value falls and every cross liquidation price moves closer to the price. If it gains, they move away.
The side-by-side view makes the difference in margin modes plain:
| Mode | What backs the position | Does the leverage setting move the liquidation price? |
|---|---|---|
| Isolated | The margin allocated to that position | Yes, it sets the allocated margin |
| Cross | The account value, including other cross positions | No |
Source for the table: Hyperliquid Docs.1
Margin tiers and large positions
Large positions get a lower maximum leverage and a higher maintenance rate. On markets with margin tiers, l comes from the tier that matches the position's value at the liquidation price,1 and the maintenance requirement includes a deduction so that it rises smoothly from one tier to the next.2 For most positions the first tier applies and the examples above hold as written; for very large positions the tier changes l, and the liquidation price moves closer to the entry. The calculator below applies the published tiers of each market.
Why the liquidation price moves after opening
The formula gives the liquidation price at a moment in time. Hyperliquid notes that the price shown once a position is opened can still differ from the final one because of funding payments and, for cross positions, changes in the unrealised profit or loss of other positions.1 In practice the inputs shift in four ways:
- Funding. Every funding payment adds to or takes from the margin, so a long that pays funding for days drifts closer to liquidation even if the price stands still.
- Margin added or removed. Isolated margin can be topped up or reduced after opening; each change moves
margin_available. - Other cross positions. As shown in the cross example.
- Partial closes. Reducing the size changes
position_sizeand the maintenance requirement at the same time.
Before a trade is entered, the venue can only show an estimate based on the expected entry price; with changing liquidity on the book, the actual entry and thus the liquidation price can differ.1
Using the formula in practice
You do not need to do the arithmetic by hand. Our liquidation calculator applies the same formula to the current margin tiers of Hyperliquid's main perpetual markets (not the builder-deployed HIP-3 markets), for isolated and cross margin, and shows the distance from entry. Its results leave out fees and funding, choose the tier by the notional at entry, and in cross mode treat the given equity as backing this one position only, so they are an approximation of the venue's own number.
For positions that are already open, the distance to liquidation page explains how we compute how far each tracked position sits from its liquidation price, and Liquidation Guard watches a wallet and alerts when a position comes within a chosen distance. Across the market, the liquidation heatmap guide shows how many such prices together form clusters.
Limits
Each venue publishes its own formula and parameters, and they change over time. The examples here use Hyperliquid's documented formula with illustrative numbers; they leave out trading fees, funding and slippage, all of which move the real result. The mark price, not the last trade, is what has to reach the liquidation price.
Sources
- Hyperliquid Docs, "Liquidations": https://hyperliquid.gitbook.io/hyperliquid-docs/trading/liquidations (accessed 2026-11-05)Back to text
- Hyperliquid Docs, "Margin tiers": https://hyperliquid.gitbook.io/hyperliquid-docs/trading/margin-tiers (accessed 2026-11-05)Back to text
How we collect and check the data: Data & methodology.
See today’s numbersThe live pages update continuously.
Open the liquidation calculator