Cryptocurrency derivatives offer high amounts of leverage and are known to experience substantial price swings. They can also suffer from low levels of liquidity during periods of market stress. As a consequence, there could be instances when liquidations are not processed quickly enough to avert bankruptcy or potential debt to the exchange. In response to such situations, we have a solution in place: Auto-Deleveraging (ADL).
ADL is a risk management mechanism designed to automatically close positions on behalf of bankrupt traders. This is achieved by pairing them with their counterparties, i.e., traders holding the opposite position. Utilized as a last line of defense, ADL serves to protect the entire trading ecosystem from potential losses stemming from derivatives trading.
Identifying an ADL Event
In the event your account is selected for ADL, it will first be locked for a few seconds, preventing you from placing orders or transferring funds. Subsequently, your active orders will be cancelled. Your account will then be unlocked once the ADL process has been completed. To identify ADL trades, look for the trade type “Auto-deleveraging” in your trade history. Alternatively, these can also be located via the API by checking for the source “108”.
ADL is impartially enforced for all traders on the platform, on both the liquidation side and the counterparty side.
ADL is initiated when the Liquidation Engine cannot close a trader’s position by trading in the order book. This occurs when a trader’s account meets either of these two conditions:
Maintenance Margin / Collateral Balance > 12.5
Collateral Balance <= 0
When either of these conditions is met, the Liquidation Engine will trigger the ADL process to close the trader’s positions.
ADL Queue Ranking
The initial step of the ADL process involves selecting counterparties to facilitate the liquidation. This is done by ranking "outright" positions based on the following formula and arranging them from highest to lowest.
PnL Percentage >= 0:
Ranking = PnL Percentage * Margin Ratio
PnL Percentage < 0:
Ranking = PnL Percentage / Margin Ratio
PnL Percentage = (Mark Value - Avg Entry Value) / Collateral Balance
Margin Ratio = Maintenance Margin / Collateral Balance
Mark Value = Position Size * Mark Price
Avg. Entry Value = Position Size * Average Entry Price
Collateral Balance = max(1, collateral balance)
To decrease the likelihood of being an ADL counterparty, you can reduce your maintenance margin or deposit more collateral.
Queue Ranking Example
Consider that Alice is LONG 15 BTC/USD Perp. Below is an example table for ranking SHORT BTC/USD perp positions.
Avg Entry Price
Given the above table of positions and their rankings, Alice’s long 15 BTC position would be closed against Bob and Charlie’s short position. Bob’s entire -10 BTC position would be closed, and Charlie’s position would be reduced by the remaining 5 BTC to -15 BTC.
If there are insufficient outright positions available to close a bankrupt trader, then hedged positions (short BTC perp + holding BTC) are ranked based on their age in descending order, meaning the account with the oldest position is selected first.
ADL Price Calculation
Once the counterparties have been selected the next step is to calculate a fair bankruptcy price for all of a trader’s open positions.
The calculation is performed via the following algorithm for all positions in the trader’s portfolio:
= mark value / active leverage tier
= simulated margin / sum(simulated margin)
Margin Weighted Loss
= collateral * margin fraction
= mark price - margin weighted loss / quantity
In summary, Auto-Deleveraging (ADL) is a crucial part of risk management on the OPNX platform. Understanding its mechanics, including triggers, ranking, and price calculation, enables traders to better manage their strategies. Through ADL, OPNX maintains a stable trading environment, protecting individual accounts and the overall ecosystem during volatile market conditions.