Trading on leverage can be risky. Make sure you are aware of the liquidation rules outlined below before applying margin.
Liquidations are a part of leveraged trading. Traders that elect to use leverage are using the collateral they deposited as margin to borrow money from the protocol. Traders may choose to do this in order to open a larger position and have more exposure to a particular asset, i.e. leveraged exposure.
When this occurs, the protocol must protect itself by ensuring that there is enough margin for the position to settle any losses that occur. There is a prescribed minimum ratio between a position's value and its margin for each asset (Minimum Maintenance Margin).
If a position drops below it's Minimum Maintenance Margin, liquidators are incentivized by the protocol to take over positions so a user's remaining collateral may settle their losses that has occured. Read for what happens when prices move rapidly and/or liquidations don't happen in time.
In the Drift v2 margin system, all positions within a subaccount (deposits, borrows, and perpetuals positions) are cross-margined.
As such, liquidations are calculated based on your account level leverage rather than isolated to the leverage present in your perpetuals and/or borrow account.
Once your collateral falls below the Minimum Maintenance Margin requirements, liquidators can liquidate any portion of assets and liabilities until your account's margin ratio is above the maintenanceRatio + liqBufferRatio. The liqBufferRatio is set on the Drift State Account and meant to sufficiently bring an account away from the liquidation boundary but heavily punish users.
Similar to margin ratio, maintenanceRatio can help measure at what level account liquidations occur. The Health measure on the user page can help visualise how close a user is to liquidation terrirtory. At 0 Health, a user can get liquidated.
Health = log(max(0, marginRatio - maintenanceRatio) + 1)
The user's trade price at liquidiation for a perpetuals position will be based on the oracle price. The penalty / fee that is set per market, likely above the normal taker fee, in order to give the liquidator a rebate.
Liquidations triggered and positions will be liquidated using margin engine prices.
In the case of an extreme oracle error (): the market will pause most fills, liquidations, and funding rate updates.
- You open a long position on SOL at $40 dollars with 10x leverage using $500 USDC
- Your position value is therefore a $5000 USDC long on SOL, with $500 USDC in margin/collateral
Note that the Minimum Maintenance Margin for a SOL-PERP is 5% (see Minimum Maintenance Margin for assets here: )
The current maintenance margin of your position is calculated by total collateral / position size.
Here, that would be 10% as 500 / 5000.
If the maintenance margin of your position drops below the Minimum Maintenance Margin of 5%, your position will be eligble for liquidation by liquidators.