Trading Formulas
Liquidation Price Calculation
In our trading system, the liquidation price is the price at which a trader’s position will be liquidated due to insufficient margin. The formula differs for long and short positions.
Formula Breakdown
We have a minimum margin requirement of 3%, which takes into account trading fee, liquidation fee and possible market slippage. This means even if you are on a 1x position, you will still see a liquidation price.
Key Definitions:
- maintenanceMarginRate:
0.03
(or 3%) – the minimum margin requirement. - accountLeverage:
max(totalPositions / totalBalance, 1)
– determines the leverage used by the trader. - marginRate:
1 / accountLeverage
– the percentage of margin available for the position.
Liquidation Price Formulas
Position Type | Formula |
---|---|
Long | marketLiquidationPrice = averagePrice * (1 - marginRate + maintenanceMarginRate) |
Short | marketLiquidationPrice = averagePrice * (1 + marginRate - maintenanceMarginRate) |