Auto Deleveraging
Information about the auto-deleveraging mechanism on GTE
ADL is a last resort measure to ensure the solvency of the protocol. It’s triggered when unrealized bad debt exceeds to the Insurance Cap of a given market.
Positions are ranked by bad debt on one side and high unrealized profit & leverage on the other, and split by side. When ADL is triggered, positions of their highest respective ranking, and opposing sides, are matched and closed at the bankruptcy price of the underwater position.
The bankruptcy price is the price at which loss == margin, resulting in no bad debt
For a long position this is
bankruptcy price = (open notional - (margin - loss from funding)) / position size
For a short position it’s
bankruptcy price = (open notional + (margin - loss from funding)) / position size