Market Cap: $2.6532T 1.33%
Volume(24h): $204.8037B 44.96%
Fear & Greed Index:

15 - Extreme Fear

  • Market Cap: $2.6532T 1.33%
  • Volume(24h): $204.8037B 44.96%
  • Fear & Greed Index:
  • Market Cap: $2.6532T 1.33%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

How do I calculate profit and loss (PnL) on OKX contracts?

OKX futures PnL depends on contract type and margin mode, with unrealized PnL based on mark price and realized PnL calculated upon closing trades, accounting for fees and funding.

Aug 13, 2025 at 11:35 am

Understanding Profit and Loss (PnL) in OKX Futures Trading

When trading futures contracts on OKX, calculating profit and loss (PnL) is essential to track performance and manage risk effectively. OKX supports both isolated and cross margin modes, and PnL calculations vary slightly depending on the mode and whether the position is open or closed. The PnL is denominated in the settlement currency of the contract, which is typically USDT for USDT-margined contracts and USD for coin-margined contracts.

There are two types of PnL: Realized PnL and Unrealized PnL.

  • Unrealized PnL reflects the current profit or loss of an open position based on the latest market price.
  • Realized PnL is the actual profit or loss locked in when a position is closed.

Each contract type has specific formulas based on entry price, exit price, leverage, and quantity.

Calculating Unrealized PnL for USDT-Margined Contracts

For USDT-margined perpetual contracts, the unrealized PnL is calculated based on the difference between the current mark price and the entry price. The formula differs for long and short positions.

For a long position:

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

For a short position:

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

The contract size is fixed per contract and varies by asset. For example, BTC/USDT contracts typically have a contract size of 0.001 BTC per contract. The mark price is used instead of the last traded price to prevent manipulation and ensure fair valuation.

Ensure the following:

  • Use the correct contract multiplier as defined by OKX.
  • Confirm whether your margin mode is isolated or cross, as liquidation calculations differ.
  • Monitor funding fees, which can impact net unrealized PnL over time.

Calculating Realized PnL for Closed Positions

When a position is closed, realized PnL is computed based on the average fill price of the closing trade and the average entry price. The formula mirrors unrealized PnL but uses executed prices.

For a closed long position:

  • Realized PnL = (Exit Price – Entry Price) × Number of Contracts Closed × Contract Size

For a closed short position:

  • Realized PnL = (Entry Price – Exit Price) × Number of Contracts Closed × Contract Size

If you partially close a position, only the closed portion is considered. OKX displays realized PnL in your wallet history after each trade. Fees are deducted from realized PnL, so taker fees (e.g., 0.05%) must be subtracted to get net profit.

To verify:

  • Check the trade details in your order history.
  • Confirm the number of contracts closed matches your intent.
  • Account for funding payments that occurred during the holding period.

Calculating PnL for Coin-Margined Contracts

Coin-margined contracts (such as BTC-USD-SWAP) are settled in the underlying cryptocurrency (e.g., BTC), not USDT. This affects PnL calculation and display.

For a long position:

  • Unrealized PnL (in BTC) = Number of Contracts × Contract Size × (1 / Entry Price – 1 / Mark Price)

For a short position:

  • Unrealized PnL (in BTC) = Number of Contracts × Contract Size × (1 / Mark Price – 1 / Entry Price)

The inverse nature arises because the margin and PnL are in BTC. As BTC price fluctuates, the USD value of PnL changes, but the BTC-denominated PnL is calculated using the above formulas.

Important considerations:

  • The liquidation price is also calculated in BTC terms.
  • Funding rates are paid in BTC.
  • Your effective profit in USD depends on the BTC/USD rate at withdrawal.

Using OKX Interface to Monitor PnL

OKX provides real-time PnL tracking in the futures trading interface. Navigate to the Positions tab to view both unrealized and realized PnL.

Key elements displayed:

  • Entry Price: Average price at which the position was opened.
  • Mark Price: Current fair value used for PnL calculation.
  • Unrealized PnL: Shown in USDT or BTC, depending on contract type.
  • ROE% (Return on Equity): Calculated as Unrealized PnL / Initial Margin × 100%.
  • Leverage: Impacts margin and ROE% but not PnL directly.

To access detailed history:

  • Go to Wallet > Transaction History > Derivatives.
  • Filter by Futures and select the appropriate contract type.
  • Export data for external analysis if needed.

Ensure your margin mode and level are correctly set, as changes affect available balance and PnL visibility.

Common Mistakes in PnL Calculation

Traders often misinterpret PnL due to overlooking key factors. One common error is confusing mark price with last traded price. PnL uses mark price, not the last price, to avoid volatility distortions.

Other pitfalls include:

  • Ignoring funding fees, which reduce net profit in long positions during positive funding.
  • Misreading contract size, especially for altcoin contracts with smaller multipliers.
  • Forgetting that partial closes only realize PnL on the closed portion.
  • Not accounting for fees, which are deducted from realized PnL.

To avoid errors:

  • Always cross-check calculations with OKX’s displayed values.
  • Use test positions with small sizes to verify understanding.
  • Enable PnL notifications in settings for real-time alerts.

Frequently Asked Questions

Q: Where can I find my realized PnL on OKX?A: Navigate to Wallet > Transaction History, select Derivatives, and filter by Futures. Realized PnL from closed positions appears here, broken down by contract and time.

Q: Does funding rate affect my PnL calculation?A: Yes. Funding payments are deducted or added to your balance every 8 hours. Long positions pay when funding rate is positive, reducing net PnL. These are reflected in your funding fee history under Wallet.

Q: Why is my Unrealized PnL negative even if the market moved in my favor?A: This can happen if funding fees outweigh price gains, or if you’re trading coin-margined contracts and the underlying asset’s value dropped in USD terms. Also, confirm you’re viewing the correct margin mode and contract type.

Q: How does leverage impact PnL on OKX?A: Leverage amplifies both gains and losses but does not change the PnL formula. Higher leverage reduces the required margin, increasing ROE% for the same price move. However, it also raises liquidation risk, which can prematurely close positions and cap PnL.

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Related knowledge

See all articles

User not found or password invalid

Your input is correct