Detailed Calculations on Margin and Liquidations
Initial Margin (IM)
Overview: Initial Margin is the margin a user needs to open a new position
Variables:
kIM: Initial Margin Factor, a setting specific to each markets: Notional Sizet: Time to maturity (in years)TimeFloor: floor for time to maturity, a setting specific to each marketRateFloor: floor for Mark Rate, a setting specific to each market
Formula:
A user is able to open a new limit order or market order, if their total Initial Margin is less than their Net Balance, or they are closing their existing position
Maintenance Margin (MM)
Overview: Maintenance Margin is the margin a user needs to have to maintain a position (and not be liquidated)
Variables:
kMM: Maintenance Margin Factor, a setting specific to each markets: Notional Sizet: Time to maturity (in years)TimeFloor: floor for time to maturity, a setting specific to each marketRateFloor: floor for Mark Rate, a setting specific to each market
Formula:
To get the settings from the API:
Notes on how to get settings from the API:
TimeFloor:
tThreshfrom the API, divided by 365*24*3600RateFloor:
1.00005^(iTickThresh*tickStep) - 1
Liquidation
Overview: a user is liquidated in a collateral zone if their Net Balance goes below Maintenance Margin
When a liquidation happens, the user’s position is closed at the mark rate, and the user loses an liquidation penalty of:
Where k will start from 25% when a position just become liquidate-able and increases linearly to 50% when the position becomes more and more unhealthy (and still not liquidated)
Last updated