DeCrypto Markets

Learn: risk and leverage

How is a liquidation price calculated in crypto?

A liquidation price is where a leveraged position's equity falls to the maintenance margin, so the venue closes it by force. For an isolated long it is entry x (1 - 1 / leverage) / (1 - maintenance rate); for a short, entry x (1 + 1 / leverage) / (1 + maintenance rate). Fees and funding bring it closer.

How it works

When you open a leveraged position, you post margin. As price moves against you, your unrealised loss is taken from that margin. The venue will not let your equity fall below a maintenance level, because it does not want to cover your losses itself. The price at which your equity meets that level is the liquidation price, and once the mark price reaches it, the venue closes the position at the market.

With isolated margin, only the margin you assigned to that position is at risk, and the liquidation price follows from the formula. With cross margin, your whole account balance backs all your positions, which pushes each liquidation price further away but means one bad position can drain the rest of your account. The games use isolated margin, because its line can be checked to the tick.

Liquidation is triggered by the mark price, not by one venue's last trade, so a single bad print does not usually close you. A real move does. When many leveraged positions sit at similar levels, their forced orders can push price further and set off a liquidation cascade.

The exact rule the games grade by

The rule the games use: margin ratio = equity / (Q x P), with equity = margin + PnL and maintenance margin mmr x Q x P at the mark. Liquidation happens when the margin ratio is at or below mmr. For isolated margin this gives: long liquidation = E x (1 - 1/L) / (1 - mmr); short liquidation = E x (1 + 1/L) / (1 + mmr). The line is shown to the tick: rounded down for a long and up for a short, the first tick that liquidates. No fees, funding or liquidation penalty are included; real venues add them. The formula needs 1/L above mmr.

Step by step

  1. Write down the side, the entry price E, the leverage L and the maintenance rate mmr.
  2. For a long, compute E x (1 - 1/L) / (1 - mmr). For a short, compute E x (1 + 1/L) / (1 + mmr).
  3. Round to the tick: down for a long, up for a short. That is the first price that liquidates.
  4. Compare the distance from entry with the coin's normal moves and with your stop.
  5. Remember that fees and funding come out of margin, so the real line sits a little closer.

Worked example

Liquidation prices around one entryLiquidation prices for an isolated long and short at 60,000 with a 0.5% maintenance rate, at 2x, 5x, 10x, 20x and 50x. Higher leverage puts the line closer to the entry.Entry 60,000Shorts liquidate aboveLongs liquidate below2x30,150.72x89,552.35x48,241.25x71,641.810x54,271.310x65,671.720x57,286.420x62,686.650x59,095.450x60,895.6
Isolated longs and shorts at 60,000 with a 0.5% maintenance rate: the liquidation line by leverage.

Take BTC at 60,000, with a maintenance rate of 0.5%. A 10x long is liquidated at 60,000 x (1 - 1/10) / (1 - 0.005) = 54,271.3, rounded down to the tick: a fall of 9.55%. A 10x short is liquidated at 60,000 x (1 + 1/10) / (1 + 0.005) = 65,671.7, rounded up: a rise of 9.45%.

Now change only the leverage. A 2x long liquidates at 30,150.7 (49.75% away); 5x at 48,241.2 (19.60%); 20x at 57,286.4 (4.52%); 50x at 59,095.4 (1.51%); and 100x at 59,698.4, only 0.50% below entry. The shorts mirror them: 62,686.6 at 20x and 60,895.6 at 50x.

In money terms: a 0.5 BTC long at 10x is a 30,000 USDT position with 3,000 USDT of margin. At 54,271.3 it has lost 2,864.35 USDT, which leaves 135.65 USDT of equity, at or below the maintenance margin of 135.68 USDT at that price: the line is the first tick where equity is at or below it. The venue closes it there; in practice fees and a liquidation penalty take most of what is left.

Takeaway: At 60,000, a 10x long liquidates at 54,271.3 and a 50x long at 59,095.4: the more leverage, the closer the line, and the formula is the best case before fees and funding.

Common mistakes

  • Using the last price instead of the mark. Venues liquidate on the mark price, built from several spot venues. A wick on one market alone may not close you; a real move will. See mark price.
  • Forgetting the maintenance rate. The line is not simply 1 / leverage away. The maintenance margin moves it closer, and venues raise the maintenance rate for larger positions.
  • Rounding the wrong way. For a long, round the liquidation price down to the tick; for a short, round up. The rounded line is the first price at which the position is closed.
  • Thinking cross margin is safer. Cross margin pushes each liquidation further away by putting your whole balance behind every position. One position going wrong can then take the balance that backed everything else.
  • Adding margin to rescue a losing trade. Topping up margin moves the line, but it also raises how much you can lose. If the trade was wrong, adding money to it is averaging down with leverage.

What this does not tell you, and what can go wrong

The formula tells you where the line sits under a clean model: isolated margin, a fixed maintenance rate, no fees, no funding, no penalty. Real venues use tiered maintenance rates by position size, charge fees and funding, and add a liquidation fee, so the real line is closer than the formula. Check your venue's own liquidation price and treat it as an estimate.

It also does not tell you how the close will go. In a fast market a liquidation can fill at a worse price than the line, and if the market gaps, a venue may use an insurance fund or, on some venues, close profitable positions of other traders to cover the loss. Many traders who use high leverage meet this line; the line on screen is a place you should never be near.

Questions people ask

How do I calculate the liquidation price of a long position?

For an isolated long, liquidation = entry x (1 - 1 / leverage) / (1 - maintenance rate). At an entry of 60,000, 10x and a 0.5% maintenance rate, that is about 54,271, a fall of about 9.5%. Real venues add fees and funding, so check their figure too.

How do I calculate the liquidation price of a short position?

For an isolated short, liquidation = entry x (1 + 1 / leverage) / (1 + maintenance rate), rounded up to the tick. At an entry of 60,000, 10x and a 0.5% maintenance rate, that is about 65,672, a rise of about 9.45%. A short can be liquidated by a fast rally just as a long can by a drop.

What is the difference between isolated and cross margin?

Isolated margin limits a position to the margin you assign to it, so only that amount is at risk and the liquidation price is easy to compute. Cross margin uses your whole account balance as margin for every position. Each liquidation sits further away, but one losing position can drain the balance behind all the others.

What happens to my money when I am liquidated?

The venue closes the position at the market. You lose the margin it used, and usually a liquidation fee on top. What is left, if anything, is returned. In isolated margin you lose at most that position's margin; in cross margin the loss can reach your whole account balance.

Practise it

Reading about a rule is not the same as applying it. These games generate a fresh simulation each round, ask you to make the call first, and grade you against the same rule.

Liquidation Price

Drag the liquidation line for an isolated long or short. Decrypt checks it to the tick.

What it teaches

Mark vs Last

A wick prints on the last price of a perpetual. Does the position liquidate? Work out the mark price and call it.

What it teaches

The LiquidatorBoss

The Liquidator offers 50x on every setup. Survive five rounds with your sizing and margin choices.

What it teaches