Contract Profit and Loss Calculation: A Comprehensive Guide

·

Single-Coin Margin Mode (Cross Margin)

Trading Modes Overview

  1. Open/Close Position Mode
    Standard trading approach for entering and exiting positions.
  2. Buy/Sell Mode
    Direct purchasing or selling of contracts without open/close distinction.

Key Terminology

TermDefinition
Position SizePositive for long positions, negative for short positions (Buy/Sell Mode).
Closable AmountCalculated as: Position Size - Pending Order Allocations (Open/Close Mode only).
Unrealized P&LCoin-Margined Contracts:
- Long: Face Value × Abs(Contracts) × Multiplier × (1/Entry Avg - 1/Mark Price)
- Short: Face Value × Abs(Contracts) × Multiplier × (1/Mark Price - 1/Entry Avg)
USDT-Margined Contracts:
- Long: Face Value × Abs(Contracts) × Multiplier × (Mark Price - Entry Avg)
- Short: Face Value × Abs(Contracts) × Multiplier × (Entry Avg - Mark Price)
ROIUnrealized P&L / Initial Margin
Initial MarginCoin-Margined: (Face Value × Abs(Contracts) × Multiplier) / (Mark Price × Leverage)
USDT-Margined: Face Value × Abs(Contracts) × Multiplier × Mark Price / Leverage
Maintenance MarginCoin-Margined: Face Value × Abs(Contracts) × Multiplier × MMR / Mark Price
USDT-Margined: Face Value × Abs(Contracts) × Multiplier × MMR × Mark Price

👉 Master margin trading strategies with OKX's advanced tools


Cross-Currency Margin Mode (Cross Margin)

Supports both Open/Close and Buy/Sell modes for perpetual/delivery contracts.

Core Metrics (Same as Single-Coin Mode)


Isolated Margin Mode (Single/Cross/Portfolio)

Trading Mode Variations

  1. Open/Close Mode
    Available for Single/Cross-Coin only (excludes Portfolio Margin).
  2. Buy/Sell Mode
    Compatible with all three margin types.

Extended Terminology

TermDefinition
Estimated Liquidation PriceCoin-Margined:
- Long: Face Value × Abs(Contracts) × (MMR + Fee Rate + 1) / (Margin Balance + Face Value × Abs(Contracts)/Entry Avg)
- Short: Face Value × Abs(Contracts) × (MMR + Fee Rate - 1) / (Margin Balance - Face Value × Abs(Contracts)/Entry Avg)
USDT-Margined:
- Long: (Margin Balance - Face Value × Abs(Contracts) × Entry Avg) / (Face Value × Abs(Contracts) × (MMR + Fee Rate - 1))
- Short: (Margin Balance + Face Value × Abs(Contracts) × Entry Avg) / (Face Value × Abs(Contracts) × (MMR + Fee Rate + 1))
Margin BalanceInitial Margin + Manual Adjustments
Margin Ratio(Margin Balance + Unrealized P&L) / (Position Value × (MMR + Fee Rate))
Coin-Margined: (Margin Balance + P&L) / (Face Value × Abs(Contracts) / Mark Price × (MMR + Fee Rate))
USDT-Margined: (Margin Balance + P&L) / (Face Value × Abs(Contracts) × Mark Price × (MMR + Fee Rate))

👉 Optimize your liquidation thresholds with OKX's risk calculator


FAQ Section

How is unrealized P&L calculated for USDT-margined shorts?

It reflects the difference between your entry price and current mark price:
Face Value × Contract Size × Multiplier × (Entry Avg - Mark Price).

What determines my position's closable amount?

In Open/Close mode, it's your total position minus any pending close orders.

Why does margin ratio matter?

It indicates your position's health relative to liquidation risk. Lower ratios trigger margin calls.

How does cross-currency margin differ?

👉 Discover cross-margin advantages on OKX
It allows collateralizing multiple currencies while maintaining uniform P&L calculations.