Skip to content

USD-Margined Wallet Calculation

Source: Notion | Last edited: 2023-03-17 | ID: 96136e57-d99...


  • IMR (Initial Margin Ratio) = 1 / Leverage
  • Initial Margin = (Quantity * Entry Price * IMR) or (Notional Value / Leverage)
    • IMR = 1 / LeverageNotional Value Notional Value

    • Notional Value = Quantity * Mark Price

    • initialMargin = positionInitialMargin + openOrderInitialMargin

  • Unrealized PNL = Position Size * Direction of Order * (Mark Price - Entry Price)
    • direction of order: 1 for long order;-1 for short order
  • Maintenance Margin = Notional Value * Maintenance Margin Rate - Maintenance Amount
  • Margin Balance = Wallet Balance + Unrealized P&L. (Your positions will be liquidated once Margin Balance <= Maintenance Margin.)
  • Wallet Balance = Total Net Transfer + Total Realized Profit + Total Net Funding Fee - Total Commission
  • Max Withdraw Amount = max(Margin Balance - 1.2 * Maintenance Margin, 0)
Reference