⚗️Liquidation
Liquidation occurs when the position value falls below the maintenance margin requirement. Liquidations are crucial for maintaining the protocol's functionality and protecting other traders.
Here is how liquidation works on Perpl:
The liquidation engine identifies undercollateralized positions
Positions are closed at the mark price
All liquidation events will be recorded on-chain. To learn more about liquidation, read our blog on understanding liquidation in perp markets.

Order Book Liquidations
Order book liquidations are initiated by the protocol; a position meeting the liquidation criteria is sold to the order book if possible, with the proceeds distributed to the original position holder, perpetual insurance fund, and protocol.
Invariant: Collateralization for liquidation:
FMV = Position fair market value. MMR = Position Maintenance margin requirement.
Calculating Liquidation Price
A position’s liquidation price can be calculated as follows:
Where:
PEntry is the entry price of the position.
s is the side of the position or position type (if the position is long, then a mark price at or below the liquidation price indicates the position should be liquidated; the opposite is true for a short position).
CMMR is the Maintenance Margin Requirement (MMR) of the position. (See note on calculating this value below.)
CDeposit is the collateral deposited in the position.
CFunding is the funding payment owed by the position (available in the smart contract as premium PNL).
L is the final liquidation lot size of the position.
The position’s MMR can be calculated as follows:
Where:
CMMF is the Maintenance Margin Fraction (MMF) of the perpetual (
Perpetual::maintMarginFracHdths).
The position’s bankruptcy price can be calculated similarly, except the Maintenance Margin Requirement value becomes zero (because the position is now bankrupt and has no value—it’s possible for a position to have a negative value at prices beneath the bankruptcy price, but this is clamped to zero in the auto-deleveraging process). The calculation of bankruptcy price is:
Partial vs Full Liquidation
Depending on the position size, the crypto asset, and market conditions, the protocol may choose to perform a partial liquidation. This allows the trader to keep the trade open for a longer period. On the other hand, positions can be fully closed. In that scenario, the proceeds are split between the protocol, the insurance fund, and the trader. Both of these liquidations happen on the order book.
Buy to Liquidate
In certain scenarios, when the position to be liquidated is too large to close out on the book, the PLP vault can buy the position to liquidate gradually.
Last updated