Liquidation isn't triggered by a price — it's triggered by running out of margin

2026-11-03来源 dev.toEnglish

Last week roughly $1.6 billion in crypto positions was liquidated in a single day after an exchange reported a theft. Almost none of those traders were wrong about the direction. They were wrong about a rule: how much margin a position must keep to stay open.

Here is the mechanism, in the order it actually fires.

1. The price that kills you is not the last traded price

Most venues compute liquidation against a mark price — an index built from several spot exchanges — rather than the last trade on their own book. The reason is protective: a single wick on one exchange shouldn't vaporise positions across the market.

That protection produces the two confusing observations you've probably seen on a forum:

  • "The candle clearly wicked down to my liquidation level, but I survived." → the mark price never got there.
  • "The candle never touched it and I still got liquidated." → the mark price did.

If you build anything that reads candles and shows a liquidation line, decide explicitly which price you are using and label it. Mixing them is the single most common source of wrong backtests.

2. The actual condition

A position ties up two things:

  • Initial margin — what you locked to open it.
  • Maintenance margin — the minimum that must remain, expressed as a percentage of the position's notional value.

Liquidation fires when:

wallet_balance < notional_value × maintenance_margin_rate 

Worked example, with round numbers:

notional = 10,000 USDT leverage = 10x initial margin = 1,000 USDT maintenance rate = 0.5% (example only) threshold = 10,000 × 0.005 = 50 USDT → the position dies once the margin balance falls to 50 USDT, i.e. after roughly 950 USDT of loss, not after 1,000. 

Those rates are per-exchange and per size tier, and higher leverage usually carries a higher maintenance rate. Read the venue's own rules page before you hard-code anything — a bot that assumes 0.5% everywhere will be confidently wrong.

3. Why liquidations cascade

A liquidation order is a market order. It takes liquidity rather than providing it. The first wave eats the best bids, the mark price moves another tick, more positions cross their threshold, and those orders hit the book too. Nothing new needs to happen for the waterfall to continue — the mechanism is self-feeding while depth is thin.

For software this matters twice: your simulator must model slippage against a shrinking book, and your risk layer should treat "distance to liquidation" as a non-linear quantity, not a linear buffer.

4. Cross vs isolated margin

  • Cross: every open position draws on the same free balance. One blown position can eat the collateral that was protecting the others.
  • Isolated: each position has its own slice; the worst case is that slice.

The difference isn't about which earns more. It's about which one survives a wick.

5. What to do before you touch real money

Two concrete calculations, both of which belong in software rather than in memory:

  1. Compute the liquidation price for the leverage you picked, then measure how many percentage points away it is from the current price.
  2. Compare that distance against the loss you decided you're willing to take. If the liquidation sits closer than your stop, the leverage is wrong — not the market.

We run this as a simulation-first flow in DeepRade: the strategy executes against replayed market data, you watch it hit liquidation in a sandbox, and only then does it get a live key. The terminal runs locally and keeps exchange API keys on your machine, so the dry run and the live run are the same code path with different credentials.

One boundary we keep hard: this explains mechanism, it does not forecast direction, and nothing here is investment advice.

The Chinese original of this piece lives at https://community.deeprade.com/t/67 — this is our own translation for the dev.to audience.

原文:https://www.a8q9.cn/en/article/liquidation-isn-t-triggered-by-a-price-it-s-triggered-by-running-out-of-margin-748343.html

相关文章