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

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 TypeFormula
LongmarketLiquidationPrice = averagePrice * (1 - marginRate + maintenanceMarginRate)
ShortmarketLiquidationPrice = averagePrice * (1 + marginRate - maintenanceMarginRate)