#
Automatic Deleveraging (ADL)
Automatic Deleveraging (ADL) is a critical risk management mechanism that activates when the insurance fund becomes insolvent and can no longer absorb liquidated positions. This documentation explains when ADL is triggered, how the process works, and how accounts are selected for deleveraging.
#
Explanation
#
What is Automatic Deleveraging?
Automatic Deleveraging (ADL) is a last-resort risk management mechanism that forcibly closes positions against other traders when the insurance fund can no longer fulfill its role. Unlike standard liquidations where the insurance fund absorbs the losing positions, ADL directly impacts other traders in the system by forcibly closing their profitable positions.
#
When ADL is Triggered
ADL is triggered when the current marked price of the instrument reaches the insurance fund's bankruptcy price for that instrument.
Note that: unlike regular account liquidations, ADL can be triggered when the mark price is exactly equal to the bankruptcy price, not just when it falls below it. This allows the system to cap the mark price precisely at the bankruptcy level to initiate ADL without requiring the insurance fund to have a negative equity.
#
Key Differences from Standard Liquidation
The ADL process differs from standard account liquidation in several important ways:
No Intermediate Checks: Once ADL is triggered, the entire process must be completed without intermediate checks. Unlike liquidations, the process doesn't stop if the insurance fund becomes solvent during execution.
No Liquidation Price Concept: The insurance fund has no margin requirement, so there is no concept of a liquidation price—only a bankruptcy price.
Forced Position Closure: ADL forcibly closes positions against other traders' opposite positions, even if there are no matching orders in the order book.
#
Reference
#
ADL Workflow
The ADL process follows these sequential steps:
Insurance Fund Bankruptcy Detection: System detects that the insurance fund has reached bankruptcy (zero equity).
Open Order Cancellation: All open orders on the insurance fund are canceled.
Account Selection for Deleveraging: Accounts with positions opposite to the insurance fund's positions are ranked according to the selection criteria.
Forced Position Closure: The insurance fund's positions are forcibly closed against the selected accounts at the current mark price until the insurance fund has no more open positions.
Forced Position Closure on other instruments: In some cases, step 4 may produce negative balances on the deleveraged account. See
below for more details on how this situation might occur and how Nekuti Matching Engine can optionally be made to prevent it.
#
Account Selection Criteria
Accounts are selected for deleveraging based on a strict priority order:
Leverage (Highest to Lowest): Accounts with the highest leverage are selected first.
Profitability (Highest to Lowest): Among accounts with the same leverage, those with the highest profits are selected first.
Balance (Lowest to Highest): Among accounts with the same leverage and profitability, those with the smallest account balance are selected first.
Account Number (Highest to Lowest): If all above factors are equal, newer accounts (higher account numbers) are selected first.
This selection process ensures that the most leveraged and profitable positions bear the impact of ADL before more conservative traders.
#
Price Determination
During ADL, positions are closed at the current mark price. In a mark price cap scenario, this is equal to the insurance fund's bankruptcy price.
#
Account Selection Example
Current state:
- Insurance fund position: Short 35 BTC
- Entry price: $38,000
- Balance: $10,000
- Current mark = Bankruptcy price = $40,000 (pnl = -$10,000)
Accounts would be selected in the following order:
#
Negative Balance Prevention
The Nekuti Matching Engine can be made to operate under strict positive balance enforcement or under the looser positive equity enforcement (which includes unrealized gains and losses).
During the ADL process, a deleveraged account may have to liquidate an instrument on which it's losing more than its current balance. The realized losses will cause the overall balance to become negative, even if the account is overall solvent because of unrealized gains in other insturments.
Under strict positive balance enforcement, we prevent this situation by forcibly realizing the gains on other instruments to cover the losses on the deleveraged instrument that may exceed the available balance.
Example:
- Account 1234 has 90,000 USD in deposited margin.
- Account 1234 has a position of long 10 BTC @ 100,000 and long 50 ETH @ 5,000.
- The current market price is BTC @ 90,000 and ETH @ 7,000
- Account 1234 loses 100,000 USD on BTC and gains 100,000 USD on ETH, resulting in a net 0 pnl.
- ADL is triggered and the insurance fund must liquidate a short 10 BTC position at the current mark price. Account 1234 is selected for deleveraging.
- After ADL, account 1234's balance is -10,000 USDT.
Under strict positive balance enforcement, the Nekuti Matching Engine will realize the gains on ETH to cover the losses on BTC. It does so by closing and re-opening the ETH position at the current mark price. The executions related to realizing the required gains (execType: LiquidationCompensationRealizePnl) are done before the deleveraging executions to prevent the balance from even temporarily going negative.
If there are more than one possible winning positions to pick from, the ADL workflow selects the instrument with the highest profitability first and works its way down the list until the 10,000 USD shortfall is covered.
Note that this mechanism can also be triggered during regular liquidations if the liquidated position happens to close an existing insurance fund position at a loss that exceeds its balance. However, this should be vanishingly rare if insurance fund's positions and margin are properly managed.