Risk Parameters Margin and Liquidations Detailed Calculations on Margin and Liquidations On this page
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 market
s: Notional Size
t: Time to maturity (in years)
TimeFloor: floor for time to maturity, a setting specific to each market
RateFloor: floor for Mark Rate, a setting specific to each market
Formula:
I M = k I M × ∣ s ∣ × m a x ( t , T i m e F l o o r ) × m a x ( m a r k R a t e , R a t e F l o o r ) IM = k_{IM} \times |s| \times max(t, TimeFloor) \times max(markRate, RateFloor) I M = k I M × ∣ s ∣ × ma x ( t , T im e Fl oor ) × ma x ( ma r k R a t e , R a t e Fl oor )
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 market
s: Notional Size
t: Time to maturity (in years)
TimeFloor: floor for time to maturity, a setting specific to each market
RateFloor: floor for Mark Rate, a setting specific to each market
Formula:
M M = k M M × ∣ s ∣ × m a x ( t , T i m e F l o o r ) × m a x ( m a r k R a t e , R a t e F l o o r ) MM = k_{MM} \times |s| \times max(t, TimeFloor) \times max(markRate, RateFloor) MM = k MM × ∣ s ∣ × ma x ( t , T im e Fl oor ) × ma x ( ma r k R a t e , R a t e Fl oor )
To get the settings from the API:
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:
L i q u i d a t i o n P e n a l t y = k ∗ m a i n t e n a n c e M a r g i n O f L i q u i d a t e d P o s i t i o n LiquidationPenalty = k * maintenanceMarginOfLiquidatedPosition L i q u i d a t i o n P e na lt y = k ∗ main t e nan ce M a r g in O f L i q u i d a t e d P os i t i o n
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)