Contract Loss Mechanisms
During periods of high volatility in the markets underlying the perpetual contracts, the value of some accounts may drop below zero before they can be liquidated. In these cases, the protocol’s deleveraging system kicks in.
Liquidation and Deleveraging
When an account is undercollateralized, the protocol automatically liquidates its positions until the account is sufficiently collateralized or the positions are closed.
If an account’s value turns negative, deleveraging occurs immediately against randomly chosen offsetting positions, which may reduce the expected profits of offsetting accounts.
Example
A deposits $100 and goes long 500 ABC contracts at $1.
B deposits $100 and goes short 500 ABC contracts at $1.
The price jumps from $1 to $2:
A expects a profit of ($2 - $1) * 500 = $500.
B’s equity becomes negative: $100 - ($2 - $1) * -500 = $-400.
B’s bankruptcy price is $1.2, so A’s position is closed at $1.2, resulting in a $100 profit for A and a $100 loss for B, leaving B’s account value at $0.
Deleveraging usually occurs after an account is eligible for liquidation, followed by further adverse price movement. If a large price shift occurs in one oracle update, an account may go directly from collateralized to negative and be immediately deleveraged.
Insurance Fund
The insurance fund covers insufficient collateral by adjusting liquidation order prices (up to a max spread from the oracle) to improve their chances of filling. See Liquidations on dYdX Chain for details.
Example
A deposits $100 and goes long 500 ABC contracts at $1 with a maintenance margin fraction (MMF) of 3%.
A’s maintenance margin requirement (MMR) = 3% * $1 * 500 = $15.
ABC’s price drops to $0.801:
A’s pnl = (0.801 - 1.000) * 500 = -$99.5.
A’s equity is now $0.50, below the MMR.
The protocol liquidates A’s position at $0.77:
Note: by default, the maximum spread at which the liquidation order may be placed from the oracle price is 1.5 * MMF = 4.5%.
A’s pnl at $0.77 would be (0.77 - 1.0) * 500 = -$115, more than A’s $100 equity.
The insurance fund contributes $15 to “aggress” the limit price, enabling a fill at $0.77.
The liquidation order is matched against the order book just like any other order; if sufficient bid liquidity exists, the fill price may be better than the limit price.
Note that once an account balance turns negative, deleveraging occurs immediately without using the insurance fund.
Disclaimer and Terms
This document may provide information with respect to the dYdX Chain software, and/or non-mandatory guidelines and suggestions that may help with using dYdX Chain software. dYdX Operations Services Ltd. does not run dYdX Chain validators nor operate or control the dYdX Chain network. dYdX Operations Services Ltd. is not responsible for any actions taken by other third parties who use dYdX Chain software. dYdX Operations Services Ltd. services and products are not available to persons or entities who reside in, are located in, are incorporated in, or have registered offices in the United States or Canada, or Restricted Persons (as defined in the Terms of Use). The content provided herein does not constitute, and should not be considered, or relied upon as, financial advice, legal advice, tax advice, investment advice or advice of any other nature, and you agree that you are responsible to conduct independent research, perform due diligence and engage a professional advisor prior to taking any financial, tax, legal or investment action related to the foregoing content. The information contained herein, and any use of products or services provided by dYdX Operations Services Ltd., are subject to the Terms of Use.