Flipster sets the liquidation priority ranking considering position profit and leverage so that more profitable and higher leveraged traders are deleveraged with priority. The priority ranking determines which positions are closed first during the liquidation process.
Standard Liquidation Priority Rankings:
- Highest Leverage or Risk: Positions with the highest leverage or greatest risk of losses are liquidated first.
- First In, First Out (FIFO): Positions that were opened first are liquidated first.
- Pro Rata: The liquidation impact is distributed proportionally across all positions based on their size.
- Others: Additional ranking methods or variations may exist, such as considering unrealized profit or loss, account equity, or a combination of factors.
Liquidation Priority Ranking Calculation:
- P&L Percent: Calculated as
max(0, Unrealized Profit) / max(1, Wallet Balance)
. - Margin Ratio: If
(Wallet Balance + Unrealized Profit) ≤ 0
, thenMargin Ratio = 0
. If(Wallet Balance + Unrealized Profit) > 0
, thenMargin Ratio = Maintenance Margin / (Wallet Balance + Unrealized Profit)
. - Leverage P&L: Calculated as
P&L Percent × Margin Ratio
. - Leverage P&L Quantile: Calculated as rank (
user.Leverage P&L) / Total User Count
.