OKX Open Interest Dataset

OKX Historical Open Interest Data

OKX open interest snapshots in venue units and quote notional, aligned with the schema used across CryptoHFTData derivatives venues.

No credit card · The sample is one real hourly Parquet file and needs no API key

Sample

See the data before you sign up

The first rows of one real hour: BTC-USDT-SWAP on OKX Futures, 2026-09-02 at 12:00 UTC. One row per open interest snapshot.

okx_futures/2026-09-02/12/BTC-USDT-SWAP_open_interest.parquetDownload full file
received_timesymbolsum_open_interestsum_open_interest_valuetimestamp
1788350406116731610BTC-USDT-SWAP2941406.140000009732258991091.301587472610811788350405985
1788350418811644258BTC-USDT-SWAP2942110.770000009452257875836.66418725225131788350418679
1788350429082922205BTC-USDT-SWAP2942328.310000009652258048668.91316740575741788350428951
1788350438844546988BTC-USDT-SWAP2942811.790000009552258522707.283097329348051788350438712
1788350449048505962BTC-USDT-SWAP2942677.85000000972258316918.49260744412921788350448916
1788350458811816212BTC-USDT-SWAP2943326.520000009712258908917.651367452114281788350458680
Showing 6 of 325 rows in this hourTimestamps are raw integers; units are in the schema below

Wire format

From exchange message to Parquet row

Every row starts as a message on the exchange's WebSocket or REST API. Point at a line or a column to see where each value comes from and how we convert it. Our test suite replays these messages through the production pipeline, so the rows shown are the rows you download.

OKX Futures

OKX sends this message every 3 seconds when open interest changes.

Exchange sends

WebSocket message · open-interestreceived 2026-10-05 19:15:12.109227 UTC

{
"arg": {
"channel": "open-interest",
"instId": "BTC-USDT-SWAP"
},
"data": [
{
"instId": "BTC-USDT-SWAP",
"instType": "SWAP",
"oi": "2850839.22000000697",
"oiCcy": "28508.3922000000697",
"oiUsd": "2440908496.03854596776279",
"ts": "1791227711966"
}
]
}

You download

Parquet row · open_interest

Point at a line in the message or a column in the row to trace where each value comes from. Click a column to pin it.

Our tests replay this message through the production pipeline

All OKX Futures mapping rules →

Conventions for every exchange are in the wire formats overview. Column types and units for open interest data are in the schema below.

Use cases

What you can build with open interest data

Leverage build-up
Watch open interest rise or fall to see when new positions are being opened or closed.
Price and positioning divergence
Combine open interest with price to separate new money entering a move from short covering or long liquidation.
Cross-venue positioning
Compare where open interest concentrates across derivatives exchanges for the same underlying.

Coverage

Open interest coverage

Every venue is stored under its own exchange ID, so spot and derivatives never mix. Bars show each venue's history from its first hourly file to today, or to its last file for a venue that is no longer collected. Symbol counts are live from the symbols API.

Open interest coverage by venue, exchange ID, market, history start, and live symbol count
VenueExchange IDMarketHistoryOpen interest symbols
OKX Futuresokx_futuresFutures
2025-06-2816 mo
638

Other exchanges

Open Interest data on other exchanges

The same schema on every venue, so switching exchange is a one-argument change.

Or compare every venue on the cross-exchange open interest overview.

Schema · 5 columns

Normalized open interest schema

Every open interest row is an exchange-published snapshot with total open interest in the venue's unit (base asset or contracts), quote notional value when available, and snapshot timing.

Columns in every open interest Parquet file
ColumnTypeDescription
received_timeINT64Unix timestamp (nanoseconds) when our system received the open interest data
symbolSTRINGTrading pair symbol (for example, 'BTCUSDT')
sum_open_interestSTRINGnullableTotal open interest in the unit of the venue (stored as string for precision). The unit is the base asset on most venues, contracts on OKX and Kraken inverse futures, and raw instrument units on BitMEX (refer to the venue notes)
sum_open_interest_valueSTRINGnullableTotal notional value of open interest in the quote currency, if the venue gives it or if we can calculate it (stored as string for precision)
timestampINT64Unix timestamp when the exchange took the open interest snapshot

Quickstart

From pip install to DataFrame in a minute

The example loads BTC-USDT-SWAP from OKX Futures for 2026-09-02. Change the symbol, exchange, or dates to pull any other slice of the archive.

  1. Install the Python SDK

    pip install cryptohftdata
  2. Create a free API key

    Sign up with email or Google, then generate a key from your dashboard. No credit card.

    Create account
  3. Call get_open_interest()

    Paste the snippet, replace YOUR_API_KEY, and you get a pandas DataFrame with the columns listed above.

okx_open_interest_data.py
import cryptohftdata as chd

client = chd.CryptoHFTDataClient(api_key="YOUR_API_KEY")

df = client.get_open_interest(
    symbol="BTC-USDT-SWAP",
    exchange=chd.exchanges.OKX_FUTURES,
    start_date="2026-09-02",
    end_date="2026-09-02",
)

print(df.head())
print(f"Open interest snapshots: {len(df):,}")
REST · no API key needed for single files
curl --fail --location \
  "https://api.cryptohftdata.com/download?file=okx_futures/2026-09-02/12/BTC-USDT-SWAP_open_interest.parquet" \
  -o BTC-USDT-SWAP_open_interest_12.parquet

Caveats

Know this before you backtest

Exchange feeds differ in subtle ways. These are the details that matter for accurate backtests, replay pipelines, and features. Missing hours and pending corrections for every venue are listed on Known Gaps & Corrections.

  1. Open interest is a periodic snapshot published by each exchange, not a continuous event stream; snapshot cadence varies by venue.

  2. sum_open_interest is in the venue's unit: base asset on most venues, contracts on OKX (multiply by ctVal) and Kraken inverse futures, raw per-instrument units on BitMEX. sum_open_interest_value is quote notional where available.

  3. This page starts on 2025-06-28 based on the earliest stored hourly files for its covered exchange IDs and grows as new hourly files are published.

FAQ

Frequently asked questions

Is OKX open interest data free to download?

Yes. A free CryptoHFTData account with no credit card gives API access to OKX open interest data and every other dataset. Individual hourly files can also be downloaded without an API key on the rate-limited free tier.

How far back does OKX open interest data go?

The earliest hourly files start on 2025-06-28, and new files are added every hour. Start dates differ by venue; the coverage table on this page lists each one.

What format are the files in?

Each file holds one symbol for one UTC hour, stored as Zstd-compressed Parquet under {exchange_id}/{YYYY-MM-DD}/{HH}/{SYMBOL}_open_interest.parquet. Parquet reads directly into pandas, Polars, DuckDB, and Arrow.

How do I load OKX open interest data in Python?

Install the SDK with pip install cryptohftdata, create a client with your API key, and call client.get_open_interest() with a symbol, exchange, and date range. It returns a pandas DataFrame.

How often is open interest recorded?

Open interest is a periodic snapshot published by each exchange, not a continuous stream. The cadence depends on the venue, so check timestamps before resampling.

Start using open interest data today.

One free API key covers every exchange and every data type. $0.00.