Auto-deleveraging
When an account goes below zero, auto-deleveraging closes the most profitable, most leveraged opposing positions at the previous mark price, leaving no bad debt.
If you’re winning against an account that runs out of money, auto-deleveraging (ADL) can close your position. Losses beyond an account’s collateral would leave the winners’ profits unbacked: bad debt. The docs set a strict invariant instead: under all operations, a user with no open positions does not socialise any platform losses.
Three steps from negative equity to a forced close
Section titled “Three steps from negative equity to a forced close”ADL follows market and backstop liquidation (leverage and liquidation).
-
Trigger: an account value (cross) or isolated position value goes negative.
-
Rank the opposite side by unrealised PnL and leverage:
adl_index = (mark_price / entry_price) * (notional_position / account_value)The first factor is the price move since entry; the second, effective leverage (notional over the equity behind it).
-
Close at the previous mark price against the underwater user, off the book. The docs say this ensures the platform has no bad debt.
A ranking, worked
Section titled “A ranking, worked”Say three longs sit opposite an underwater short, with the mark at 150:
| Trader | Entry | Notional | Account value | Price factor | Leverage factor | Index |
|---|---|---|---|---|---|---|
| A | 100 | 15,000 | 3,000 | 1.50 | 5.0 | 7.50 |
| B | 140 | 15,000 | 7,500 | 1.07 | 2.0 | 2.14 |
| C | 100 | 3,000 | 3,000 | 1.50 | 1.0 | 1.50 |
A has B’s notional with a larger gain and less equity, so the highest index; C has A’s gain without leverage, so the lowest. The docs do not state the queue’s direction; read as a profit-and-leverage measure, A goes first.
Each HIP-3 dex is its own solvency domain
Section titled “Each HIP-3 dex is its own solvency domain”Each HIP-3 dex margins independently, with an on-chain backstop liquidator that is an independent user (table). The docs say it makes cross-enabled assets significantly less likely to see ADL in high volatility, and that scaled-out backstop liquidators will reduce the need for ADL.
Implied but not spelled out: a noCross or strictIsolated asset has no per-dex backstop, so if the book cannot close such a position before it goes negative, the next documented step is ADL.
The numbers
Section titled “The numbers”| Item | Value |
|---|---|
| Trigger | account value (cross) or isolated position value below 0 |
| Who is closed | users on the opposite side of the underwater position |
| Sorting index | (mark_price / entry_price) * (notional_position / account_value) |
| Execution price | previous mark price |
| Counterparty | the underwater user; no order book |
| Backstop-liquidated positions | no special treatment in the queue |
| Invariant | a user with no open positions never socialises losses |
| Place in the sequence | after market liquidation (below maintenance) and backstop liquidation (below 2/3 of maintenance) |
| HIP-3 backstop liquidator | 0x4000000000000000000000000000000000000000 + dex_index; cross-enabled assets only; falls back to ADL |
What ADL means for your positions
Section titled “What ADL means for your positions”- ADL risk sits with the winners, in proportion to gain and leverage. Taking profit, or adding collateral to run the same notional at lower leverage, lowers your index.
- The exit price is not yours: it is the previous mark, off the book. A hedge held elsewhere is left open.
- Only a flat account is fully protected by the invariant.
Monitoring your index from code
Section titled “Monitoring your index from code”adl_index = (markPx / entryPx) * (positionValue / accountValue)
markPx metaAndAssetCtxs, or the activeAssetCtx subscriptionentryPx clearinghouseState.assetPositions[].position.entryPxpositionValue clearinghouseState.assetPositions[].position.positionValueaccountValue clearinghouseState.marginSummary.accountValue (see the gaps below)- No documented field, fill flag or order status marks an ADL close; liquidation fills carry
liquidation.method"market"or"backstop"only. Reconcile position size fromclearinghouseState(or its subscription) after volatile moves, and treat unexplained changes as possible ADL. - A delta-neutral strategy should alert on a one-sided change and re-hedge or unwind: ADL removes one leg only.
- A HIP-3 deployer can fund the backstop with
hip3LiquidatorTransfer(liquidation). It helps only on cross-enabled assets, and enabling cross is irreversible and subject to validator eligibility checks (operating a perp dex).
Unresolved gaps in the docs
Section titled “Unresolved gaps in the docs”- Shorts: the index is written once for both sides. For a profitable short,
mark_price / entry_priceis below 1 and falls as profit grows; the docs do not say whether it is inverted. - Which account value: for an isolated position
account_valueis undefined; isolated margin plus PnL is the plausible reading, not a documented one. - Which previous mark: marks update about every 3 seconds; “previous” is not defined further.
- Cross-dex margin: how an ADL queue is scoped when an account sharing margin across dexes (unified account or portfolio margin) goes negative is undocumented.
- Portfolio margin: liquidations go directly to the backstop liquidator at
0xbbb...b; the docs say nothing about ADL for these accounts. - No history: no documented info request lists past ADL events.
For who shares collateral, see Margin. For HLP, whose liquidator vault is the validator-operated backstop, see Vaults.