Module 7 · Lesson 49 of 55

How liquidations really work on a perp DEX

⏱ 9 min read ● Intermediate Module 7 · Derivatives: perpetual DEXes

Lesson 44 explained why leverage turns a small move into a large loss. This lesson opens the machine: what a venue actually does, in what order, when your margin runs out, and who ends up holding the position you lost.

Three prices, one that matters

A perp DEX shows several prices for the same market. The last price is simply the most recent trade on its own order book. The index price (Hyperliquid calls it the oracle price) is an external reference, usually a weighted median of spot prices on large exchanges, and it drives funding. The mark price is the venue's estimate of fair value: typically a median of the index, the index plus a smoothed premium, and the venue's own best bid, best ask and last trade. Margin, unrealised PnL and liquidation are all calculated on the mark, not on the last trade, so a single odd fill on a thin book cannot liquidate you by itself. The next lesson covers what happens when the mark itself is wrong.

Initial vs. maintenance margin

Initial margin is what you must post to open a position: notional divided by leverage, so 10% at 10×. Maintenance margin is the smaller amount you must keep as the position moves against you. On Hyperliquid it is half of the initial margin at the asset's maximum leverage, which works out between 1.25% (40× assets) and 16.7% (3× assets) of notional; dYdX and Lighter express the same idea as a per-market maintenance margin fraction. The gap between the two is your buffer. Once your equity (margin plus unrealised PnL) falls below the maintenance requirement, the venue is allowed to close you.

The liquidation price, worked through

Take a long of 1 BTC at $100,000 with 10× leverage on a market with a 2.5% maintenance margin.

  • Notional: $100,000. Initial margin posted: $10,000.
  • Maintenance margin: 2.5% × $100,000 = $2,500.
  • You are liquidated when equity falls to $2,500, which means a $7,500 loss: $100,000 − $7,500 = $92,500, a 7.5% drop.

The shortcut for a long is entry × (1 − 1/leverage + maintenance rate); for a short, flip the signs. Venues that measure the maintenance requirement against the mark at liquidation rather than against the entry price land slightly differently (Hyperliquid's published formula gives about $92,300 for the same trade), and fees and funding move it further. Treat the number on the trade ticket as the authoritative one, and notice what it says: at 10× you are not liquidated at a 10% move. You are liquidated at 7.5%, because the venue stops you before your margin reaches zero.

Partial or full

Most order-book venues liquidate in stages. Lighter defines tiers: below initial margin you may only reduce risk; below maintenance margin the engine cancels your open orders and sends immediate-or-cancel orders position by position until you are back above the line; below a lower close-out margin the whole account is taken over. Hyperliquid sends market orders for the full size, but for positions above 100,000 USDC only 20% goes to the book at first, followed by a 30-second cooldown. The practical point: a partial liquidation is not a reprieve. Your resting orders are gone, part of your position has been sold at the worst moment, and the next leg is usually close behind.

The penalty

Liquidation is never free. On dYdX the penalty is capped at 1.5% of the position, taken from whatever is left in the account and paid to the insurance fund. Lighter charges up to 1% when the fill beats its reference price and routes it to LLP. Hyperliquid charges no fee on the liquidation order itself, but if the position reaches the backstop stage the maintenance margin is not returned. In every design the margin you lose on the way down is at least the maintenance margin, usually more.

Who takes the position

Three layers, in order:

  1. The order book. The venue sells your position into resting bids. If the book absorbs it above the bankruptcy price, the story ends here.
  2. A backstop vault or insurance fund. If the book cannot, a protocol-owned pool takes the position at a discount and unwinds it later. On Hyperliquid this is the liquidator vault, a strategy inside HLP, which steps in when equity drops below two-thirds of the maintenance margin; HLP depositors earn the spread and carry the risk. Lighter's LLP plays the same role but only takes a position if doing so keeps the pool above its own initial margin requirement. dYdX uses an insurance fund that absorbs profits and losses from liquidations and can improve a liquidation order's price up to a maximum spread from the oracle.
  3. Auto-deleveraging (ADL). If an account's value turns negative and no vault can carry it, the venue closes profitable traders on the opposite side against the bankrupt account at the last mark price. Hyperliquid ranks candidates by profit multiplied by leverage; dYdX picks offsetting positions at random. ADL is how a venue without a central balance sheet stays solvent, and it means a winning trade can be closed for you without warning.

Bad debt and cascades

Bad debt is what is left when a position is closed below its bankruptcy price: a negative balance nobody has paid. On a CEX the insurance fund eats it quietly. On a DEX it lands on a vault, on ADL counterparties or, in the worst case, on everyone. Hyperliquid's docs promise that a user with no open positions never socialises losses; that promise is enforced by ADL.

Cascades happen because liquidations are market sells. Each forced sale pushes the mark lower, which drags the next tier of long liquidation prices into range, which sells more. On 10 October 2025 roughly $19 billion was liquidated across crypto in a day, more than $10 billion of it on Hyperliquid. The order book and HLP absorbed most of it, HLP earned an estimated $40 million that weekend, and the venue ran its first cross-margin ADL in over two years. Lighter degraded before the crash and later paid LLP depositors in points; dYdX Chain halted and liquidated at stale prices on restart. The venue that stays online in a cascade is the one you want; see the incident timeline.

What to do with this

  • Check the liquidation price on the ticket before you confirm, and compare it with your stop. The stop must trigger first (risk management lesson).
  • Use isolated margin on anything thin or newly listed, so one liquidation cannot pull in the rest of the account.
  • Read the venue's liquidation page once. Whether there is a vault, an insurance fund or only ADL tells you who stands between you and bad debt.
  • Remember that ADL cuts both ways: being on the right side of a crash does not guarantee you keep the position.
≡Key terms
Mark price — The venue's fair-value estimate, usually a median of the index and its own book; margin, PnL and liquidation are measured on it.
Maintenance margin — The minimum equity a position must keep open; falling below it allows the venue to liquidate.
Bankruptcy price — The price at which a position's margin is exactly used up; closing below it creates bad debt.
Backstop (liquidator) vault — A protocol-owned pool, such as Hyperliquid's HLP or Lighter's LLP, that takes over positions the order book cannot absorb.
Insurance fund — A reserve, as on dYdX, that absorbs liquidation losses and receives liquidation penalties.
Auto-deleveraging (ADL) — Closing profitable opposite-side positions against a bankrupt account so the venue stays solvent.
Bad debt — A negative account balance left after liquidation that some vault, counterparty or fund has to absorb.
!Common mistakes
  • Assuming a 10× position is liquidated at a 10% move; the maintenance margin brings it closer, to 7.5% in the worked example.
  • Watching the last trade instead of the mark price, which is the number that actually triggers liquidation.
  • Treating a partial liquidation as a warning rather than the first leg of a full one, and leaving the position open.
  • Expecting a winning position to be safe during a crash; ADL can close it early at the mark price.
  • Depositing into a backstop vault for yield without understanding that it underwrites every thin market the venue lists.

Written and reviewed by the dexwatch editorial team. Last updated 2026-10-27. Educational content, not financial advice. Spotted an error? Tell us.

Finished reading? Track your progress through the journey.