Skip to content
Finance Lessons

DeFi Derivatives & Perpetuals

Insurance Funds & Auto-Deleveraging

What backstops a perp when a liquidation closes below bankruptcy. How the insurance fund absorbs bad debt and grows from liquidation surpluses, why it can still run dry, and how auto-deleveraging (ADL) socializes the remaining loss onto the most-profitable opposing traders — with the ranking and worked numbers.

12 min Updated Jun 8, 2026

The previous lesson ended on a dangling risk: the liquidation engine tries to close a doomed position in the window between the liquidation price and the bankruptcy price — but in a fast, gappy market it can fail, closing below bankruptcy, where the position’s loss exceeds its margin. That shortfall is bad debt, and it has to be paid by someone. This lesson is about the two backstops that catch it: the insurance fund and, when that’s not enough, auto-deleveraging (ADL). These are the shock absorbers that keep a perp exchange solvent through a crash.

Before you read — take a guess

A liquidated position is closed at a price WORSE than its bankruptcy price, so the loss is bigger than the trader's posted margin. Who covers the shortfall first?

Why bad debt happens at all

In a perfect market, the liquidation engine always closes a position somewhere between the liquidation and bankruptcy prices, the trader’s margin covers the loss, and nobody else is affected. Reality is messier.

Analogy. Think of a fire department that liquidates burning buildings before the fire spreads. Usually they arrive in time and the damage stays inside the lot. But in a firestorm — high wind, many fires at once — they sometimes can’t contain a blaze before it jumps the property line, and the damage spills onto the neighbors. The insurance fund is the city’s disaster reserve that pays for that overspill so the neighbors are made whole.

Bad debt arises when the close happens worse than bankruptcy:

  • Price gaps. A sudden crash jumps straight past the liquidation price to well below bankruptcy before any keeper can execute — the close fills at a loss bigger than the margin.
  • Thin liquidity. Dumping a large liquidated position into a shallow order book pushes the fill price far past bankruptcy.
  • Cascades. Many liquidations firing at once flood the book with forced sells, each one worsening the fill for the next — the very cascade we model below.

In all three, the liquidated trader’s margin runs out before the position is closed, and the difference is owed to the profitable counterparties. The system must source that money somewhere.

Think first

Why is bad debt especially likely during a liquidation cascade, rather than during a single isolated liquidation?

Hint: What do many simultaneous forced sells do to the price the next liquidation fills at?

The insurance fund: a shared reserve that absorbs the overspill

Definition. The insurance fund is a pooled reserve of collateral held by the exchange/protocol whose job is to absorb bad debt from liquidations that close below bankruptcy, so the winning side of every trade still gets paid in full. It’s the first line of defense after a position’s own margin is exhausted.

Where does its money come from? Mostly from liquidation surpluses. Here’s the elegant part: most liquidations close better than bankruptcy — the trader is liquidated at, say, the liquidation price, but the engine actually fills slightly above bankruptcy, leaving a small surplus (the equity that remained between the liquidation trigger and the fill). That surplus is swept into the insurance fund. So in calm markets the fund quietly grows on the back of orderly liquidations, building a war chest for the violent ones.

insurance fund+=(liquidation fills above bankruptcy)(bad debt below bankruptcy).\text{insurance fund} \mathrel{+}= \sum (\text{liquidation fills above bankruptcy}) - \sum (\text{bad debt below bankruptcy}).

In normal conditions the first term dominates and the fund grows; in a crash the second term spikes and the fund is drawn down. A healthy exchange runs a fund large enough to absorb realistic crashes without ever touching the next backstop.

Info:

The insurance fund is not infinite — and that's the whole point of ADL

The fund is a buffer, not a guarantee. In an extreme, fast crash with a big cascade, bad debt can outrun the fund and drain it. When that happens, the exchange has a choice: either eat the loss itself (bankruptcy risk for the venue) or socialize the remaining shortfall onto traders. The mechanism for the second option is auto-deleveraging — the controlled way to make sure the exchange itself never goes insolvent, by passing the unpayable loss to the people best able to absorb it.

Where does the insurance fund get most of its money in normal market conditions?

When even the fund runs dry: auto-deleveraging (ADL)

Suppose the cascade is so violent that bad debt exhausts the insurance fund. The winning traders are owed profits that the losing traders’ margin and the fund can’t cover. The exchange refuses to go insolvent. The last-resort tool is auto-deleveraging.

Definition. Auto-deleveraging (ADL) is a mechanism that, when the insurance fund can’t cover a bankruptcy, forcibly closes the positions of profitable traders on the opposite side at the bankruptcy price, using their unrealized profit to absorb the loss. It socializes the unpayable loss onto the traders who can most afford it.

Analogy. Imagine a poker table where one player goes bust owing more than their chips, and the house’s emergency fund is empty. ADL is the table rule that says: the biggest winners must cash out a chunk of their winnings right now, at a fixed price, to cover the deadbeat’s debt — because they’re the ones holding the profit that the loss has to come from. It’s not theft; it’s the only way to settle the table without the house itself going broke.

Who gets deleveraged — the ADL ranking. Not everyone is hit equally. The exchange ranks opposing-side traders by a priority score, and deleverages from the top down. The score combines:

  • Profitability — how much unrealized profit the position has (more profit → higher priority to be closed).
  • Leverage — higher effective leverage → higher priority.

So the traders most in profit and most leveraged on the opposite side are the first to be auto-closed. The intuition: they have the most “house money” to give up, and their high leverage makes them the riskiest positions to leave open anyway. Most exchanges show you an ADL indicator (a row of lights) warning how near the front of the queue you are.

A massive short-side cascade creates bad debt that drains the insurance fund. Under ADL, whose positions are force-closed to cover the shortfall, and at what price?

Worked example: insurance fund, then ADL

Make it concrete. A short position with $2,000 margin and $100,000 notional gets caught in a crash. Its bankruptcy price is where its $2,000 of equity is wiped — but the market gaps, and the engine can only close it at a price where the realized loss is $3,500.

Step 1 — bad debt. Loss ($3,500) exceeds margin ($2,000), so the bad debt is

3,5002,000=$1,500.3{,}500 - 2{,}000 = \$1{,}500.

Step 2 — insurance fund absorbs it. Suppose the insurance fund holds $50,000. It pays the $1,500 shortfall to the profitable longs on the other side, so they’re made whole. The fund drops to $48,500. No ADL needed — this is the normal, healthy path.

Step 3 — the fund-exhaustion scenario. Now imagine a far bigger cascade where total bad debt is $70,000 but the fund holds only $50,000. The fund covers $50,000 and is drained to zero; $20,000 of bad debt remains. ADL kicks in: the system walks down the ADL ranking of profitable longs, force-closing them at the bankruptcy price until $20,000 of their unrealized profit has absorbed the remaining loss. A long sitting at the top of the queue with, say, $8,000 of unrealized profit might be fully closed, contributing its profit; the queue continues until the $20,000 is covered.

The punchline: the exchange stays solvent at every step. Bad debt is paid first by the loser’s margin, then by the shared insurance fund, then — only if that’s exhausted — by clawing back the winners’ profits via ADL. Nobody’s deposited collateral is confiscated; ADL only touches unrealized profit on the opposing side.

Fill in the backstop waterfall.

Pick the right option for each blank, then check.

When a liquidation closes below the price, the loss exceeds the trader's margin, creating bad debt. The first backstop is the , which is funded mostly by liquidation in calm markets. If that reserve is exhausted, force-closes the most traders on the opposite side at the bankruptcy price, socializing the remaining loss.

Seeing the cascade that creates the bad debt

The whole reason bad debt clusters is the cascade: liquidations beget forced selling, which begets lower prices, which begets more liquidations. The simulator below makes the reflexive loop tangible — set a shock, then step it and watch each rung of liquidations push the price into the next rung. Every position closed in that downdraft is a candidate to fill below bankruptcy and feed the insurance fund’s bad-debt tally.

The cascade that drains the insurance fundLiquidated: 0/12
Open positionLiquidated
Price: $30,000

Leveraged longs sit at a ladder of liquidation prices. Apply a shock, then step: each batch of liquidations dumps forced sells that push the price down into the next rung. In a steep, thin market these later fills land below bankruptcy — that is exactly the bad debt the insurance fund must absorb, and if the cascade is violent enough, the debt outruns the fund and ADL takes over.

Warning:

Misconception: 'a big insurance fund means I can't be ADL'd'

A healthy, large insurance fund makes ADL rare, but it doesn’t make you immune. ADL risk is highest exactly when you’re winning big in a violent move — a sharp crash that bankrupts the other side and overwhelms even a large fund. The cruel irony: ADL closes your most profitable position right at the bankruptcy price, cutting short the trade that was working best, precisely when volatility is highest. Watch the exchange’s ADL indicator; being deep in profit on a one-sided market is the danger zone, not a victory lap.

Cause and effect: why does a violent liquidation cascade make ADL more likely than a series of small, isolated liquidations?

Big picture

Insurance funds and ADL — the backstop waterfall

  • Backstops
    • Bad debt
      • Close below bankruptcy → loss > margin
      • Caused by gaps, thin books, cascades
    • Insurance fund
      • Pooled reserve absorbs bad debt
      • Grows from liquidation surpluses
      • Buffer, not a guarantee
    • Auto-deleveraging (ADL)
      • Last resort when fund is exhausted
      • Closes most profitable + leveraged opposite side
      • At the bankruptcy price; touches only profit
    • Why it works
      • Exchange never goes insolvent
      • Loss socialized to those best able to bear it
      • ADL indicator warns your queue position
Bad debt from below-bankruptcy closes is paid first by the loser's margin, then the shared insurance fund (grown from liquidation surpluses), then ADL on the most-profitable opposite-side traders.

Recap: insurance funds and ADL

Question 1 of 50 correct

Bad debt on a perp exchange is created when:

Check your answer to continue.

You now understand the full solvency stack of a perp: margin, liquidation engine, insurance fund, and ADL — the layered backstops that let a leveraged 24/7 market survive a crash without the venue going broke. So far we’ve treated “the exchange” as a black box. Next we crack it open: the three competing architectures for a perp DEX — on-chain order books, virtual AMMs, and oracle/pool designs — and the deep trade-offs between decentralization, capital efficiency, and oracle risk that each one makes.

Mark lesson as complete