Market Cap: $2.2043T 0.58%
Volume(24h): $56.8553B 3.76%
Fear & Greed Index:

39 - Fear

  • Market Cap: $2.2043T 0.58%
  • Volume(24h): $56.8553B 3.76%
  • Fear & Greed Index:
  • Market Cap: $2.2043T 0.58%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

How to Check OKX Futures Profit History? Complete Tutorial

To access OKX futures profit history, use the web interface’s “Assets > Futures > History > Profit & Loss” tab (max 90 days) or the python-okx API’s `get_position_history()` with pagination for older data.

Aug 07, 2026 at 06:19 am

Accessing Futures Profit History via OKX Web Interface

1. Log in to your OKX account using verified credentials and navigate to the “Assets” section on the top navigation bar.

2. Select “Futures” from the dropdown menu to enter the futures wallet dashboard.

3. Click the “History” tab located directly beneath the balance summary panel.

4. Choose “Profit & Loss” from the filter options—this displays all realized PnL entries sorted chronologically.

5. Use the date range selector to specify start and end timestamps; default view shows the last 30 days but supports up to 90 days per query.

Retrieving Profit Data Through python-okx API

1. Initialize the AccountAPI module with valid API credentials and set flag='1' for real trading environment.

2. Call get_position_history() with parameters including instType='SWAP', instId='BTC-USDT-SWAP', and limit=100.

3. Parse response data to extract fields such as realizedPnl, fee, ts (timestamp), and ordId for each closed position.

4. Aggregate results across multiple pages by iterating with before and after cursor values until no more records are returned.

5. Convert raw millisecond timestamps into ISO 8601 format for readability and align with local timezone settings using Python’s datetime library.

Understanding Profit Calculation Logic on OKX Futures

1. Realized profit is computed upon position closure and equals (exitPrice - entryPrice) × positionSize × contractMultiplier for long positions.

2. For short positions, the formula reverses: (entryPrice - exitPrice) × positionSize × contractMultiplier.

3. Fees are deducted separately and include taker/maker rates plus funding settlement charges applied at periodic intervals.

4. Unrealized PnL is excluded from historical profit reports—it appears only in active position tracking and resets upon closure.

5. Cross-margin and isolated-margin modes affect fee allocation and liquidation thresholds but do not alter the core PnL arithmetic.

Data Export and Local Storage Options

1. Within the OKX web interface, click the “Export” button next to the PnL table to download a CSV file containing all visible rows.

2. The exported file includes columns: Date, Instrument, Side, Size, Entry Price, Exit Price, Realized PnL, Fees, and Net Profit.

3. When using python-okx, construct a Pandas DataFrame from API responses and save it locally with df.to_csv('okx_futures_pnl.csv', index=False).

4. Enable automatic daily export by scheduling a cron job that triggers a script fetching the previous day’s PnL records using before and after timestamps.

5. Store encrypted backups of exported files using AES-256 encryption tools to comply with personal data protection requirements.

Frequently Asked Questions

Q1: Can I retrieve profit history older than 90 days through the OKX web interface?No. The web interface enforces a strict 90-day limit for direct retrieval. To access older records, use the python-okx get_position_history() method with appropriate pagination handling.

Q2: Why does my exported CSV show zero fees for some positions?This occurs when the position was opened and closed during a maker rebate period or involved no taker liquidity consumption. Funding fees may also be absent if the position duration fell between settlement cycles.

Q3: Is realized PnL displayed before or after tax deductions?OKX does not perform tax withholding. All PnL values shown are gross amounts prior to any jurisdictional tax obligations.

Q4: Does the API return unrealized PnL in profit history endpoints?No. Endpoints like get_position_history() exclusively deliver finalized, closed-position data. Unrealized values appear only in real-time position snapshots via get_positions().

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