Auto-Deleveraging (ADL)
Auto-deleveraging is the mechanism of last resort when an account goes bankrupt (negative equity) and the insurance fund cannot cover the deficit. Instead of socializing losses across all users, ADL closes the bankrupt account’s positions against the highest-ranked profitable counterparties at mark price.
When ADL Triggers
ADL is triggered when both conditions are met:
- An account’s equity is negative after liquidation
- The insurance fund is insufficient to cover the deficit
needs_adl = account.equity(mark_prices) < 0ADL Ranking Formula
Counterparties are ranked by a composite score that prioritizes accounts with high unrealized profit and high effective leverage:
score = price_ratio * leverage_ratioWhere:
price_ratio = mark_price * 10,000 / entry_price
leverage_ratio = abs_notional * 10,000 / account_equityBoth components use 10,000 as a scaling factor for integer precision. The combined score is scaled by 10,000^2 = 100,000,000.
Ranking Logic
- Higher score = deleveraged first
- Traders who are more profitable (higher
price_ratio) are ranked higher - Traders who are more leveraged (higher
leverage_ratio) are ranked higher - Accounts with zero or negative equity are excluded from ranking (they cannot absorb ADL)
- Accounts with zero entry price are excluded
Example:
| Counterparty | Entry Price | Mark Price | Notional | Equity | Price Ratio | Leverage Ratio | Score |
|---|---|---|---|---|---|---|---|
| A | 90 | 110 | 1,000 | 500 | 12,222 | 20,000 | 244,440,000 |
| B | 100 | 110 | 1,000 | 500 | 11,000 | 20,000 | 220,000,000 |
| C | 105 | 110 | 800 | 50,000 | 10,476 | 160 | 1,676,160 |
Counterparty A is deleveraged first (highest score), followed by B, then C.
ADL Execution
- The bankrupt account’s position in each market is identified
- Counterparties on the opposite side are collected and ranked
- Starting from the highest-ranked counterparty, positions are closed at mark price until the bankrupt position is fully unwound
- If a single counterparty’s position is insufficient, ADL proceeds to the next counterparty
Fill Mechanics
- All ADL fills execute at the current mark price
- The counterparty’s position is reduced (or closed) by the transferred size
- Realized PnL for the counterparty is computed and credited to their collateral
- The bankrupt account’s position is correspondingly reduced
No Socialized Losses
A critical property of the ADL system: bystander accounts are never affected. Only counterparties on the opposite side of the bankrupt position participate in ADL. An account on the same side as the bankrupt position (or in a different market entirely) experiences zero impact to their equity, positions, or collateral.
ADL Indicator
The trading interface displays an ADL indicator showing each position’s ranking in the ADL queue. Traders near the top of the queue (high profit, high leverage) can reduce their ADL risk by:
- Reducing position size
- Taking partial profit to lower unrealized PnL
- Reducing leverage (adding margin)
Comparison with Socialized Loss
| Mechanism | Who Absorbs Losses | Impact on Others |
|---|---|---|
| Insurance fund | Protocol reserve | None |
| ADL | Highest-ranked counterparties | Targeted, proportional |
| Socialized loss | All users equally | Universal, indiscriminate |
GX Exchange does not use socialized loss. The insurance fund and ADL system ensure that losses are absorbed in a predictable, targeted manner.