TradingAuto-Deleveraging

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:

  1. An account’s equity is negative after liquidation
  2. The insurance fund is insufficient to cover the deficit
needs_adl = account.equity(mark_prices) < 0

ADL Ranking Formula

Counterparties are ranked by a composite score that prioritizes accounts with high unrealized profit and high effective leverage:

score = price_ratio * leverage_ratio

Where:

price_ratio    = mark_price * 10,000 / entry_price
leverage_ratio = abs_notional * 10,000 / account_equity

Both 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:

CounterpartyEntry PriceMark PriceNotionalEquityPrice RatioLeverage RatioScore
A901101,00050012,22220,000244,440,000
B1001101,00050011,00020,000220,000,000
C10511080050,00010,4761601,676,160

Counterparty A is deleveraged first (highest score), followed by B, then C.

ADL Execution

  1. The bankrupt account’s position in each market is identified
  2. Counterparties on the opposite side are collected and ranked
  3. Starting from the highest-ranked counterparty, positions are closed at mark price until the bankrupt position is fully unwound
  4. 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

MechanismWho Absorbs LossesImpact on Others
Insurance fundProtocol reserveNone
ADLHighest-ranked counterpartiesTargeted, proportional
Socialized lossAll users equallyUniversal, indiscriminate

GX Exchange does not use socialized loss. The insurance fund and ADL system ensure that losses are absorbed in a predictable, targeted manner.