USDT-margined Margin and PnL Calculations

# USDT-margined Margin and PnL Calculations

Understanding how margin requirements and profit/loss (PnL) are calculated is essential for effectively trading USDT-margined perpetual contracts. This guide explains the key calculations and concepts related to margin and PnL for USDT-margined contracts.

# Initial Margin Calculation

The initial margin is the amount of USDT required to open a position. It is calculated using the following formula:

Initial Margin = Position Value / Leverage

Where:

  • Position Value = Contract Size × Entry Price × Number of Contracts
  • Leverage = The selected leverage ratio (e.g., 10x, 50x, 100x)

For example, if you want to open a 1 BTC long position at $50,000 with 10x leverage:

  • Position Value = 1 × $50,000 = $50,000
  • Initial Margin = $50,000 / 10 = $5,000 USDT

# Maintenance Margin

The maintenance margin is the minimum amount required to keep your position open. If your margin ratio falls below the maintenance margin ratio, your position will be at risk of liquidation.

Maintenance Margin = Position Value × Maintenance Margin Rate

The maintenance margin rate varies based on the position size tier (refer to the Ladder Maintenance Margin Rate documentation for details).

# Margin Ratio Calculation

The margin ratio indicates how close your position is to liquidation. It is calculated as:

Margin Ratio = (Position Margin + Unrealized PnL) / Position Value × 100%

When the margin ratio falls below the maintenance margin rate plus the closing fee rate, liquidation will be triggered.

# PnL Calculations for USDT-margined Contracts

# Unrealized PnL

Unrealized PnL represents the profit or loss that would be realized if you closed your position at the current mark price. For USDT-margined contracts:

For Long Positions:

  • Unrealized PnL = (Mark Price - Entry Price) × Contract Size × Number of Contracts

For Short Positions:

  • Unrealized PnL = (Entry Price - Mark Price) × Contract Size × Number of Contracts

For example, if you go long 1 BTC at $50,000 and the mark price rises to $55,000:

  • Unrealized PnL = ($55,000 - $50,000) × 1 = $5,000 USDT

# Realized PnL

Realized PnL is the actual profit or loss after closing a position. It is calculated as:

For Long Positions:

  • Realized PnL = (Exit Price - Entry Price) × Contract Size × Number of Contracts - Trading Fees

For Short Positions:

  • Realized PnL = (Entry Price - Exit Price) × Contract Size × Number of Contracts - Trading Fees

For example, if you close your long 1 BTC position at $55,000 after entering at $50,000, with a 0.075% trading fee:

  • Realized PnL = ($55,000 - $50,000) × 1 - ($55,000 × 1 × 0.075%) = $5,000 - $41.25 = $4,958.75 USDT

# Liquidation Price Calculation

The liquidation price is the price at which your position will be liquidated if the market moves against you. It is calculated differently for long and short positions:

For Long Positions:

  • Liquidation Price = Entry Price × (1 - Initial Margin / Position Value) / (1 - Maintenance Margin Rate)

For Short Positions:

  • Liquidation Price = Entry Price × (1 + Initial Margin / Position Value) / (1 + Maintenance Margin Rate)

For example, for a long 1 BTC position at $50,000 with 10x leverage and a 0.5% maintenance margin rate:

  • Initial Margin = $50,000 / 10 = $5,000
  • Liquidation Price = $50,000 × (1 - $5,000 / $50,000) / (1 - 0.005) = $50,000 × 0.9 / 0.995 = $45,226.13

# Impact of Leverage on Margin and PnL

Higher leverage reduces the initial margin required but also increases the risk of liquidation. With higher leverage:

  1. A smaller initial margin is required to open a position
  2. The liquidation price will be closer to the entry price
  3. PnL calculations remain the same, but the percentage return on initial margin increases

For example, comparing 10x and 100x leverage for a $50,000 BTC position:

With 10x leverage:

  • Initial Margin = $5,000 USDT
  • A 10% price increase results in a 100% return on margin

With 100x leverage:

  • Initial Margin = $500 USDT
  • A 1% price increase results in a 100% return on margin
  • But a 1% price decrease could lead to liquidation

# Important Considerations

  1. Mark Price vs. Last Price: All PnL and liquidation calculations use the mark price, not the last traded price, to prevent market manipulation.
  2. Funding Rate Impact: Funding payments affect your realized PnL but are not included in the basic PnL calculations above.
  3. Cross Margin vs. Isolated Margin: In cross margin mode, all available balance in your USDT futures account can be used to prevent liquidation. In isolated margin mode, only the allocated margin for the specific position will be used.