-
bitcoin $86353.520310 USD
1.06% -
ethereum $2748.504094 USD
0.61% -
tether $0.999805 USD
0.00% -
bnb $789.713139 USD
0.35% -
xrp $1.621177 USD
6.50% -
usd-coin $0.999968 USD
-0.01% -
solana $118.732892 USD
1.75% -
tron $0.343839 USD
-1.32% -
zcash $1622.688363 USD
8.33% -
hyperliquid $97.151941 USD
2.83% -
dogecoin $0.101886 USD
2.10% -
monero $571.352536 USD
-0.93% -
chainlink $13.016236 USD
0.75% -
cardano $0.257732 USD
5.00% -
unus-sed-leo $8.985389 USD
0.15%
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.
- Near.com and Ondo Finance Forge a New Frontier for Tokenized Stocks, ETFs, and Commodities
- 2026-09-23 05:05:01
- NEAR Protocol Solutions Tackle Lost Keys and Enhance Usability with Readable Accounts
- 2026-09-23 05:05:01
- Zcash Takes Center Stage: European ETP Launch Follows US ETF Approval, Igniting 'Bitcoin Alternative' Debate
- 2026-09-23 05:10:01
- 21Shares Expands Product Suite with New Zcash ETP, Enhancing European Investor Access
- 2026-09-23 04:50:01
- Aave Borrowing Limit, Bitcoin-Backed Loans: Strike's 'Volatility-Proof' Solution Amidst Tightening Aave Proposals
- 2026-09-23 05:10:01
- CME Group Expands Crypto Offerings with Bitcoin Cash and Uniswap Futures Amidst Growing Institutional Interest
- 2026-09-23 05:15:01
Related knowledge
How to Buy ADA on Coinbase?
Sep 22,2026 at 01:20am
Market Volatility Patterns1. Bitcoin price swings often exceed 15% within a 24-hour window during major macroeconomic announcements. 2. Altcoin indice...
How to Check XRP Real-Time Price on Bybit?
Sep 21,2026 at 06:20pm
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How to Find SUI/USDT on Bybit?
Sep 22,2026 at 12:39am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How to Buy SUI with USDT on Bybit?
Sep 21,2026 at 03:20pm
Accessing the SUI/USDT Trading Pair1. Log in to your Bybit account using verified credentials and ensure two-factor authentication is active.2. Naviga...
How to Buy LTC on OKX?
Sep 23,2026 at 04:39am
Account Setup and Verification1. Download the OKX mobile application or access the official website via a desktop browser. 2. Complete email or phone ...
How to Buy PEPE with USDT on OKX?
Sep 22,2026 at 04:59am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How to Buy ADA on Coinbase?
Sep 22,2026 at 01:20am
Market Volatility Patterns1. Bitcoin price swings often exceed 15% within a 24-hour window during major macroeconomic announcements. 2. Altcoin indice...
How to Check XRP Real-Time Price on Bybit?
Sep 21,2026 at 06:20pm
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How to Find SUI/USDT on Bybit?
Sep 22,2026 at 12:39am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
How to Buy SUI with USDT on Bybit?
Sep 21,2026 at 03:20pm
Accessing the SUI/USDT Trading Pair1. Log in to your Bybit account using verified credentials and ensure two-factor authentication is active.2. Naviga...
How to Buy LTC on OKX?
Sep 23,2026 at 04:39am
Account Setup and Verification1. Download the OKX mobile application or access the official website via a desktop browser. 2. Complete email or phone ...
How to Buy PEPE with USDT on OKX?
Sep 22,2026 at 04:59am
Bitcoin Halving Mechanics1. Bitcoin’s protocol enforces a fixed issuance schedule where block rewards are cut in half approximately every 210,000 bloc...
See all articles














