Trading on leverage essentially means taking up debt to boost your position. If a user opens a 20x leveraged position with 100 UST as margin then the user’s initial position is 2000 UST and out of which 1900 UST is borrowed. The margin rate at this moment is 5%.
Margin rate plays a very vital role in keeping the position open. If your margin rate falls below the maintenance margin, the position gets liquidated.
The margin ratio is calculated by adding your margin size and unrealized PnL for the position and then dividing by the position notional.
Margin ratio = (Margin + Unrealized PnL)/Position Notional
Ariel has a few safety checks in place to protect traders from short term contract price severe volatility: In normal circumstances, Position Notional is calculated as Position Size*contract price. However in the event of volatility when the contract price moves more than 10% (subject to improvements in the future) from the index price, Position Notional is calculated with index price instead of the contract price. PnL calculation is critical for liquidations. PnL is calculated as the higher value between the contract price and 10 min TWAP of the contract price.