Liquidations act as position transfers between accounts. Liquidator accounts thus need to be collateralised in order to satisfy the transfer's initial margin requirements.
There are four instructions pertaining to liquidations:
Liquidator takes over user perpetual positions at a discount.
Liquidator takes over borrow at a discount to the deposit value.
Liquidator takes over borrow for discount P&L.
Liquidator takes over negative P&L for discounted deposit.
Bankruptcy (see Insurance Fund ) is possible if you still have outstanding liabilities and no further assets after liquidation.
Liquidators are open-sourced and can be triggered by anybody running a liquidator bot. Liquidators, also known as Keepers, will have their collateral reward credited to their Drift account.
Liquidations will be triggered and positions will be liquidated based on oracle price, not the mark price of the exchange.
The user's trade price at liquidation for a perpetual position will be based on the oracle price + the penalty / fee that is set per market.
In the case of an oracle error (): the market will pause most fills, liquidations, and funding rate updates.
If you would like to run a liquidator bot, see Tutorial: Liquidation Bot