Margin calculations
IM, MM and liquidation formula
Last updated
IM, MM and liquidation formula
Initial Margin (IM): collateral required to open a position.
Maintenance Margin (MM): minimum collateral to keep a position open; falling below triggers liquidation.

Let IMR = 1 / MaxLeverage and MMR be the maintenance margin ratio (displayed in the UI; subject to change per market).
Ignoring fees/funding for intuition, for a position opened at price Pe:
Long liquidation (approx.):
Short liquidation (approx.):
Where 𝑞 > 0 is quantity, 𝑀 is isolated margin, and m = 10% is the maintenance ratio
These are simplified for intuition. Actual liquidation considers live mark, fees, funding accrual, and execution slippage.
Last updated