How Liquidation Works, and How to Size a Position
Maintenance margin is half the initial margin at max leverage. The liquidation formula, a sizing method that survives a gap, and what a backstop liquidation costs.
We receive a share of the fees you pay. You still pay less than you would signing up directly.
Almost every page on this site tells you to size for the gap and warns that leverage is what kills accounts. That advice is useless without arithmetic, so here is the arithmetic.
Nothing here requires you to trust us. Every number comes from Hyperliquid’s own documentation, and the worked examples below can be checked against the formula the exchange publishes.
Your account starts in cross margin
Deposits are credited to your cross margin balance, and positions open in cross margin by default. It is worth knowing what that means before it matters.
Cross margin shares collateral across every cross position you hold. It is the more capital-efficient mode, and it has a specific failure shape: a losing position draws on the collateral supporting all the others. One trade going badly can liquidate positions that were doing fine.
Isolated margin fences a fixed amount of collateral to one position. If that position is liquidated, the loss stops at the margin you allocated to it and the rest of the account is untouched. There is also a stricter variant where margin cannot be pulled back out — it is released proportionally as you close.
For a single directional trade, isolated is the more legible choice, because it turns “how much can this cost me” into a number you set in advance rather than one you have to derive.
The two numbers that decide everything
Initial margin is what you post to open a position:
position size × mark price ÷ leverage
Maintenance margin is the level your equity must stay above. This is the part that catches people, because it is not a property of the leverage you chose:
The maintenance margin is half the initial margin at the asset’s maximum leverage.
So it is a property of the market. Gold allows 25x, which means initial margin at max leverage is 4%, which means the maintenance margin is 2% — and that 2% applies whether you opened at 25x or at 2x. For the markets covered on this site:
Read that table the other way round and it says something useful: the markets that allow the most leverage are the ones that liquidate you soonest. A 50x limit does not mean the venue thinks the S&P is safe. It means your equity only has to fall to 1% of your notional before the position is taken away from you.
The formula, and the version you can do in your head
Hyperliquid publishes the exact calculation:
liq_price = price − side × margin_available / position_size / (1 − l × side)
where side is 1 for a long and −1 for a short, l is the maintenance margin fraction from the table above, and margin_available is your isolated margin (or account value, if cross) minus the maintenance margin required.
For a single isolated position that reduces to something you can work out without opening a spreadsheet. Call your margin fraction m — that is simply 1 ÷ your chosen leverage, so 5x means 20%. Then:
- Long: liquidation distance = (m − maintenance margin) ÷ (1 − maintenance margin)
- Short: liquidation distance = (m − maintenance margin) ÷ (1 + maintenance margin)
A worked example you can check
Gold at $4,375.90. You open a $1,000 long at 5x, posting $200 of isolated margin. Maintenance margin on gold is 2%, so $20 is required and $180 is available. Your position is 0.22852 oz.
Straight from the published formula: $4,375.90 − $180 ÷ 0.22852 ÷ 0.98 = $3,572.16, which is 18.37% below entry.
From the shorthand: (20% − 2%) ÷ (1 − 2%) = 18.37%. Same answer.
Note the asymmetry in those two lines. A short is liquidated slightly sooner than a long at the same leverage — 17.1% versus 17.9% on a 20x-maximum market at 5x — because the position grows as the price moves against you. It is a small effect, and it is the opposite of what most people assume.
What leverage actually buys you
Here is the same market at different leverage settings. This is a 20x-maximum market, so maintenance margin is 2.5%:
| Your leverage | Margin posted | Liquidated at |
|---|---|---|
| 2x | 50% | 48.7% against you |
| 3x | 33% | 31.6% against you |
| 5x | 20% | 17.9% against you |
| 10x | 10% | 7.7% against you |
| 20x | 5% | 2.6% against you |
And on the S&P 500 at its 50x maximum, the liquidation distance is 1.01%. The index has moved more than that on a great many ordinary afternoons. At maximum leverage on that contract you are not taking a directional view; you are betting that nothing normal happens.
Leverage and size are two different decisions
Most people collapse these into one, which is why the advice “use less leverage” so often fails to help.
With isolated margin the two questions come apart cleanly:
- How much am I prepared to lose? That is the isolated margin you allocate. It is the answer, set in advance.
- How much room does this position need before it is taken away? That is the liquidation distance, and leverage is the dial that sets it.
Nothing forces you to answer the second question with the number that maximises the first. A $200 isolated position at 3x risks the same $200 as one at 20x — it just survives a 31.6% move instead of a 2.6% one, because the notional is smaller.
A sizing method that survives a gap
Work backwards from the move the position has to live through, not forward from the capital you have.
Step 1 — Fix the loss. Decide what this trade may cost you, in currency. That is your isolated margin.
Step 2 — Fix the move it must survive. Not the move you expect; the adverse move this market genuinely produces. Look at the real behaviour: an earnings gap on NVIDIA is routinely high single digits, a Monday open can erase a whole weekend’s move, an oracle step on the DRAM index has no prices in between.
Step 3 — Convert. Required margin fraction = (move × (1 − maintenance margin)) + maintenance margin.
Step 4 — Get your position size. Notional = your margin ÷ that fraction.
The method on a real trade
You will risk $200 on NVIDIA through an earnings print, and you want to survive a 15% adverse gap. Maintenance margin is 2.5%.
Margin fraction = (0.15 × 0.975) + 0.025 = 17.1%. Position = $200 ÷ 0.171 = $1,168 of notional, which is 5.8x — so take 5x and give yourself the rounding.
The instinct would have been “$200 at 20x is $4,000 of exposure.” That position is gone on a 2.6% move, which on this stock is a quiet Tuesday.
What actually happens when you are liquidated
Liquidation is not a tidy close at your liquidation price. The sequence is:
The book gets first refusal. Your position is closed by sending market orders to the order book. In a thin market — a weekend, the minutes after a print — those orders walk down the book and you are filled worse than the trigger.
Large positions go in pieces. Positions above 100,000 USDC are only 20% liquidated at first, with a 30-second cooldown before more. This is gentler than an all-at-once close, and it means a large position can be partially liquidated several times on the way down.
Below two-thirds of maintenance margin, you lose the maintenance margin too
If the book cannot absorb the position and your equity falls below two-thirds of the maintenance margin, a backstop liquidation transfers it to the liquidator vault — and in that event the maintenance margin is not returned to you.
This is the gap between what people expect liquidation to cost and what it costs. The intuition is “I lose my margin down to the maintenance level.” In a backstop you lose that remainder as well, and on a cross position the whole cross account goes, not just the trade that failed.
Three ways the formula quietly stops protecting you
Gaps. A liquidation price assumes the price travels through it. Across a weekend close, an earnings print or an oracle step, it does not — there are no prices in between, and you are filled on the far side. This is why position sizing is the only defence that works across a gap and a stop-loss is not. Every market on this site has at least one of these discontinuities.
Margin tiers. For assets with margin tiers, the maintenance requirement depends on the tier your position value falls into. Large positions face a stricter requirement than the table above, so a size that works at $1,000 does not simply scale.
Funding. Funding is charged hourly against your balance whether or not the price moves. A position that goes nowhere still walks slowly toward its liquidation price, and on a crowded market it walks quickly — check the annualised rate before assuming a quiet position is a safe one.
The short version
- Maintenance margin is set by the market, not by you: half the initial margin at that market’s maximum leverage.
- Your leverage choice sets only one thing — how far the price can move before the position is taken away.
- Decide your acceptable loss first, the survivable move second, and let those two produce the position size.
- The maximum leverage a market offers is a description of the venue’s risk tolerance, not a suggestion.
Common questions
How is the liquidation price calculated on Hyperliquid?
liq_price = price − side × margin_available / position_size / (1 − l × side), where side is 1 for a long and −1 for a short, l is the maintenance margin fraction, and margin_available is your isolated margin (or account value if cross) minus the maintenance margin required. For a single isolated position it simplifies to: liquidation distance = (your margin fraction − maintenance margin) ÷ (1 − maintenance margin) for a long.
What is the maintenance margin on Hyperliquid?
Half the initial margin at the asset's maximum leverage, which makes it a property of the market rather than of the leverage you selected. A 20x-maximum market has a 2.5% maintenance margin; a 50x market has 1%; a 10x market has 5%.
What is the difference between cross and isolated margin?
Cross margin shares collateral across all your cross positions, so one losing trade can draw down the collateral supporting the others. Isolated margin fences a fixed amount to a single position, capping what that trade can cost you. Deposits and new positions default to cross.
How far can the price move before I am liquidated at 10x?
On a market with a 2.5% maintenance margin, a 10x long is liquidated roughly 7.7% against you. At 20x it is 2.6%, and at 5x it is 17.9%. On the S&P 500 contract at its 50x maximum, it is about 1%.
Do I lose more than my margin in a liquidation?
Not more than your margin, but possibly all of it. If the order book cannot absorb the position and equity falls below two-thirds of the maintenance margin, a backstop liquidation moves it to the liquidator vault and the maintenance margin is not returned. On a cross position the entire cross account is affected, not only the losing trade.
Does a stop-loss protect me instead of position sizing?
Not across a gap. A stop assumes the price passes through your level; at a weekend open, an earnings print or an oracle step it does not, and the order fills on the far side. Position sizing is the only defence that works when there are no prices in between.
Can funding alone get me liquidated?
Yes. Funding is charged hourly against your balance regardless of price movement, so a position that goes nowhere still moves toward its liquidation price. On a crowded market where the annualised rate is high, that drift is fast enough to matter.
Next
What a perpetual actually gives you covers the instrument itself, and the funding rate table shows what holding one currently costs across every liquid market. If you have not funded an account yet, getting USDC across has the deposit minimum that catches people first.
Related markets
Change record
- Page created. Margin and liquidation mechanics verified against Hyperliquid's published documentation; worked examples cross-checked against the official liquidation price formula.
Last updated 2026-08-11