Protocol
Liquidation
When a user's account value falls below the maintenance margin, all their positions are liquidated. This is done to ensure the protocol's solvency and to protect the AMM from being undercollateralized.
Liquidations are executed automatically by the protocol.
Liquidation process
- The protocol monitors the account value of all users in real-time.
- When it's detected that a user's account value has fallen below the maintenance margin, the protocol will automatically close all positions in the user's account against the respective AMM.
- If the user's balance is positive after the sale, standard fees will be deducted from the proceeds.
- If the user's balance is negative, the liquidating AMM will cover the loss.
- The protocol will then return any remaining funds to the user.