Torch-Trade/okx-multi-asset-1h

Dataset

okx-multi-asset-1h (v2026.09)

0

4 commits

1 linked in READMEs

updated Sep 15, 2026

See the code

README

okx-multi-asset-1h (v2026.09)

Hourly market data for 40 OKX USDT-margined perpetual swaps across asset classes (21 equity, 15 crypto, 4 commodity), on one common hourly grid, for portfolio management research with TorchTrade.

Coverage

First bar2026-03-12 00:00 UTC
Last bar2026-09-13 23:00 UTC (covers the hour until 2026-09-14 00:00)
Length186 days, 4,464 hourly bars per instrument
Rows178,560 bars (40 x 4,464), 22,893 funding settlements
SourceOKX public REST API and OKX monthly historical-data archives

Every instrument has every hour in this window. The start is fixed by the most recently listed instruments (AMD-USDT-SWAP, EWY-USDT-SWAP, ORCL-USDT-SWAP, TSM-USDT-SWAP, listed on OKX 2026-03-11; see listed on OKX below): there is no earlier data for them anywhere on OKX. Most other instruments have longer histories on OKX (BTC and ETH perps hourly bars back to 2019-12).

Features

ohlcv_1h.parquet, one row per instrument and hour, sorted by inst_id, timestamp:

ColumnTypeMeaning
timestampdatetime64[ns]Bar open time in UTC (timezone-naive). The bar covers [timestamp, timestamp + 1h).
inst_idstringOKX instrument id, e.g. BTC-USDT-SWAP, AAPL-USDT-SWAP, XAU-USDT-SWAP.
open, high, low, closefloat64Last-traded price in USDT per unit of the underlying (one coin, one share, one troy ounce of gold, ...).
volumefloat64Traded amount in units of the underlying (contracts x contract size).
quote_volumefloat64Traded notional in USDT.
mark_closefloat64OKX mark price at the end of the hour. OKX computes unrealized PnL and liquidations from the mark price, not the last trade.

funding.parquet, one row per funding settlement:

ColumnTypeMeaning
timestampdatetime64[ns]Settlement time in UTC.
inst_idstringOKX instrument id.
funding_ratefloat64Rate for that settlement as a decimal. Payment = position notional x rate; longs pay shorts when positive.

instruments.parquet, one row per instrument, snapshot at build time (not point-in-time): inst_id, inst_type, asset_class (crypto / equity / commodity), base, list_time, ct_val (contract size), max_leverage, tick_size, lot_size, min_size, rule_type.

quality.csv: the validation statistics behind the guarantees below, one row per instrument.

No derived features (returns, indicators, normalisation) are included; compute them from the raw columns so that you control lookback and point-in-time correctness.

Guarantees

Every instrument has every hourly bar in the window, with a mark price, no duplicates, no NaN, no non-positive prices, and consistent OHLC. Nothing was filled, interpolated or adjusted: the build refuses to write the dataset otherwise. Funding merges OKX's monthly archives with the REST history, and the build checks that both agree wherever they overlap.

Caveats

  • Weekends: equity and commodity perps trade 24/7 on OKX. Bars while the underlying market is closed are OKX-internal price discovery, usually with thin volume.
  • Short history: equity perps listed in 2026-02/03, so this is an evaluation and benchmark set more than a large training set.
  • No-trade hours: some equity perps have hours with zero volume (flat OHLC equal to the previous close), mostly on weekends and in the first weeks after listing. Such a bar means no trade, not missing data. See flat_zero_volume_bars in quality.csv.
  • Funding intervals vary: most instruments settle every 8h, but OKX changes intervals per instrument (e.g. HYPE 4h to 8h, CL 8h to 4h in 2026-04). Apply funding at the settlement timestamps in funding.parquet instead of assuming a fixed interval.
  • Universe selection uses end-of-window information. The instruments were selected at the end of the window (2026-09-14 for v2026.09): listed before the start, median daily quote volume of at least $1M over the last 90 days; all qualifying equities and commodities, plus the 15 highest-volume crypto perps with at least one year of history. Liquidity correlates with past performance, so this favours assets that did well during the window (see Jiang et al. 2017, §3.1). For v2026.09, applying the same rule with only the first 30 days (2026-03-12 to 2026-04-10) selects 20 of the same 40 instruments: all 4 commodities, 10 of the 15 crypto perps (BCH, FIL, ONT, TAO and TRUMP instead of AAVE, LINK, NEAR, UNI and WLD), and 6 of the 21 equities (COIN, CRCL, HOOD, MSTR, NVDA, TSLA); most equity perps traded less than $1M a day in the weeks after listing. Instruments delisted before the scan are missing from both selections (survivorship). For backtests, split chronologically and report that the universe was chosen with information from the end of the window.
  • Corporate actions: prices are as traded. Several equity perps outside this universe (KORU, MUU, SPCX) show unadjusted 12-25x price breaks; the worst-hour column below lets you check that no instrument here has one.

Usage

import pandas as pd
from huggingface_hub import hf_hub_download
from okx_data.resample import resample_ohlcv

path = hf_hub_download("Torch-Trade/okx-multi-asset-1h", "ohlcv_1h.parquet", repo_type="dataset",
                       revision="v2026.09")  # pin a version; omit for the latest
bars = pd.read_parquet(path)
bars_4h = resample_ohlcv(bars, "4h")   # buckets 00:00, 04:00, ... UTC
bars_1d = resample_ohlcv(bars, "1D")   # any rule that divides a day works
close = bars.pivot(index="timestamp", columns="inst_id", values="close")

resample_ohlcv is in the TorchTrade portfolio-management repo; it takes first/max/min/last for open/high/low/close (and last for mark_close), sums volumes, and drops incomplete buckets.

Versions and getting more data

Each release is a git tag of this dataset named after the month of its last bar (vYYYY.MM). This is version v2026.09; older versions stay loadable with revision=<tag>, so results can always be reproduced.

The dataset is built by scripts/build_cross_asset_dataset.py in the TorchTrade portfolio-management repo, from free public OKX endpoints (no API key).

  • Newer data, same universe: rerun with a later end date, e.g. uv run python scripts/build_cross_asset_dataset.py --end 2026-12-01, and publish the result as a new tag (v2026.11) of this dataset.
  • Earlier data: not possible for the equity and commodity perps (they did not exist before their listing date). A crypto-only dataset can start as early as each coin's OKX history.
  • More instruments: OKX lists new perps regularly. scripts/scan_universe.py scans all live USDT instruments and reports history depth, liquidity and correlation; add qualifying names to the instrument lists at the top of the build script.
  • Finer resolution: 1-minute candles and tick-level trades are available from OKX's monthly archives (/api/v5/public/market-data-history, modules 2 and 1).
  • Delisting: if an instrument is delisted the build stops with an error rather than silently shrinking the universe.

Instruments

instrumentclasslisted on OKXmax leveragemean $vol/dayann volworst hour (log ret, mark)max |close/mark-1|funding interval h
CL-USDT-SWAPcommodity2026-03-0450101,295,9120.652026-04-07 22:00 (-0.095, -0.095)0.00344,8
NG-USDT-SWAPcommodity2026-03-10502,057,9110.442026-03-20 21:00 (-0.060, -0.060)0.00278
XAG-USDT-SWAPcommodity2026-01-285064,115,4730.532026-03-23 11:00 (+0.048, +0.049)0.00178
XAU-USDT-SWAPcommodity2025-04-09100250,101,9470.262026-03-23 00:00 (-0.023, -0.023)0.00118
AAVE-USDT-SWAPcrypto2020-12-105033,876,4700.792026-06-25 13:00 (-0.067, -0.065)0.00138
ADA-USDT-SWAPcrypto2020-02-285055,235,7530.722026-08-22 05:00 (-0.089, -0.089)0.00228
BNB-USDT-SWAPcrypto2022-12-235060,907,0990.402026-06-25 13:00 (-0.038, -0.038)0.00078
BTC-USDT-SWAPcrypto2019-11-121006,027,149,7880.392026-06-25 13:00 (-0.049, -0.049)0.00098
DOGE-USDT-SWAPcrypto2020-04-2150351,286,3900.602026-08-22 05:00 (-0.070, -0.071)0.00088
ETH-USDT-SWAPcrypto2019-11-121007,148,512,4570.532026-06-25 13:00 (-0.062, -0.062)0.00098
HYPE-USDT-SWAPcrypto2025-02-2150289,460,7590.842026-08-19 19:00 (+0.121, +0.122)0.00184,8
LINK-USDT-SWAPcrypto2020-02-285037,704,8840.602026-06-25 13:00 (-0.058, -0.058)0.00118
NEAR-USDT-SWAPcrypto2020-12-215050,970,7290.972026-08-22 05:00 (-0.080, -0.079)0.00218
PEPE-USDT-SWAPcrypto2023-05-0350129,821,4600.792026-08-20 08:00 (+0.071, +0.072)0.00218
SOL-USDT-SWAPcrypto2021-01-22100742,861,0350.572026-06-25 13:00 (-0.061, -0.061)0.00098
SUI-USDT-SWAPcrypto2023-05-055070,328,1990.742026-08-22 05:00 (-0.106, -0.107)0.00118
UNI-USDT-SWAPcrypto2020-09-175042,600,8160.862026-06-17 11:00 (-0.088, -0.087)0.00188
WLD-USDT-SWAPcrypto2023-07-2450119,825,9821.242026-06-05 02:00 (-0.120, -0.118)0.00248
XRP-USDT-SWAPcrypto2019-11-12100243,665,2470.572026-08-22 05:00 (-0.084, -0.085)0.00188
AAPL-USDT-SWAPequity2026-03-04205,208,7070.292026-07-30 20:00 (-0.048, -0.046)0.00568
AMD-USDT-SWAPequity2026-03-11257,360,8220.702026-08-04 20:00 (-0.093, -0.082)0.01148
AMZN-USDT-SWAPequity2026-02-26202,114,1170.352026-07-30 20:00 (+0.075, +0.077)0.00328
COIN-USDT-SWAPequity2026-02-26202,847,0410.722026-07-31 13:00 (-0.072, -0.072)0.00288
CRCL-USDT-SWAPequity2026-02-262522,767,4620.942026-03-24 14:00 (-0.098, -0.099)0.00228
EWY-USDT-SWAPequity2026-03-11508,061,8090.682026-07-29 19:00 (-0.061, -0.062)0.00638
GOOGL-USDT-SWAPequity2026-03-04504,550,6260.332026-04-29 20:00 (+0.054, +0.054)0.00438
HOOD-USDT-SWAPequity2026-02-25202,446,9410.732026-06-10 13:00 (+0.091, +0.091)0.00288
INTC-USDT-SWAPequity2026-02-262524,647,5920.872026-04-23 20:00 (+0.142, +0.143)0.00198
META-USDT-SWAPequity2026-03-04202,413,7860.422026-07-29 20:00 (-0.088, -0.090)0.00478
MSFT-USDT-SWAPequity2026-03-04202,927,7040.332026-07-29 22:00 (+0.055, +0.054)0.00558
MSTR-USDT-SWAPequity2026-02-252514,415,6170.812026-06-25 13:00 (-0.098, -0.098)0.00248
MU-USDT-SWAPequity2026-03-0450160,295,4170.912026-06-24 20:00 (+0.135, +0.136)0.00638
NVDA-USDT-SWAPequity2026-03-045013,839,8530.382026-06-25 13:00 (-0.049, -0.049)0.00118
ORCL-USDT-SWAPequity2026-03-11203,902,9960.622026-06-10 20:00 (-0.082, -0.076)0.00458
PLTR-USDT-SWAPequity2026-02-26202,043,7450.582026-08-03 20:00 (+0.111, +0.112)0.00158
QQQ-USDT-SWAPequity2026-03-04259,851,8580.222026-06-25 13:00 (-0.030, -0.030)0.00268
SNDK-USDT-SWAPequity2026-03-0475530,492,3021.092026-07-30 13:00 (+0.110, +0.110)0.00438
SPY-USDT-SWAPequity2026-03-04501,855,3560.152026-03-23 11:00 (+0.021, +0.019)0.00258
TSLA-USDT-SWAPequity2026-02-252511,460,6930.442026-07-23 13:00 (-0.056, -0.056)0.00138
TSM-USDT-SWAPequity2026-03-11202,142,0800.452026-06-25 13:00 (-0.050, -0.050)0.00248
finance
portfolio-management
torchtrade
trading

Contributors

torchtrade

4 commits

Torch-Trade/okx-multi-asset-1h

Dataset

okx-multi-asset-1h (v2026.09)

0

4 commits

1 linked in READMEs

updated Sep 15, 2026

See the code

README

okx-multi-asset-1h (v2026.09)

Hourly market data for 40 OKX USDT-margined perpetual swaps across asset classes (21 equity, 15 crypto, 4 commodity), on one common hourly grid, for portfolio management research with TorchTrade.

Coverage

First bar2026-03-12 00:00 UTC
Last bar2026-09-13 23:00 UTC (covers the hour until 2026-09-14 00:00)
Length186 days, 4,464 hourly bars per instrument
Rows178,560 bars (40 x 4,464), 22,893 funding settlements
SourceOKX public REST API and OKX monthly historical-data archives

Every instrument has every hour in this window. The start is fixed by the most recently listed instruments (AMD-USDT-SWAP, EWY-USDT-SWAP, ORCL-USDT-SWAP, TSM-USDT-SWAP, listed on OKX 2026-03-11; see listed on OKX below): there is no earlier data for them anywhere on OKX. Most other instruments have longer histories on OKX (BTC and ETH perps hourly bars back to 2019-12).

Features

ohlcv_1h.parquet, one row per instrument and hour, sorted by inst_id, timestamp:

ColumnTypeMeaning
timestampdatetime64[ns]Bar open time in UTC (timezone-naive). The bar covers [timestamp, timestamp + 1h).
inst_idstringOKX instrument id, e.g. BTC-USDT-SWAP, AAPL-USDT-SWAP, XAU-USDT-SWAP.
open, high, low, closefloat64Last-traded price in USDT per unit of the underlying (one coin, one share, one troy ounce of gold, ...).
volumefloat64Traded amount in units of the underlying (contracts x contract size).
quote_volumefloat64Traded notional in USDT.
mark_closefloat64OKX mark price at the end of the hour. OKX computes unrealized PnL and liquidations from the mark price, not the last trade.

funding.parquet, one row per funding settlement:

ColumnTypeMeaning
timestampdatetime64[ns]Settlement time in UTC.
inst_idstringOKX instrument id.
funding_ratefloat64Rate for that settlement as a decimal. Payment = position notional x rate; longs pay shorts when positive.

instruments.parquet, one row per instrument, snapshot at build time (not point-in-time): inst_id, inst_type, asset_class (crypto / equity / commodity), base, list_time, ct_val (contract size), max_leverage, tick_size, lot_size, min_size, rule_type.

quality.csv: the validation statistics behind the guarantees below, one row per instrument.

No derived features (returns, indicators, normalisation) are included; compute them from the raw columns so that you control lookback and point-in-time correctness.

Guarantees

Every instrument has every hourly bar in the window, with a mark price, no duplicates, no NaN, no non-positive prices, and consistent OHLC. Nothing was filled, interpolated or adjusted: the build refuses to write the dataset otherwise. Funding merges OKX's monthly archives with the REST history, and the build checks that both agree wherever they overlap.

Caveats

  • Weekends: equity and commodity perps trade 24/7 on OKX. Bars while the underlying market is closed are OKX-internal price discovery, usually with thin volume.
  • Short history: equity perps listed in 2026-02/03, so this is an evaluation and benchmark set more than a large training set.
  • No-trade hours: some equity perps have hours with zero volume (flat OHLC equal to the previous close), mostly on weekends and in the first weeks after listing. Such a bar means no trade, not missing data. See flat_zero_volume_bars in quality.csv.
  • Funding intervals vary: most instruments settle every 8h, but OKX changes intervals per instrument (e.g. HYPE 4h to 8h, CL 8h to 4h in 2026-04). Apply funding at the settlement timestamps in funding.parquet instead of assuming a fixed interval.
  • Universe selection uses end-of-window information. The instruments were selected at the end of the window (2026-09-14 for v2026.09): listed before the start, median daily quote volume of at least $1M over the last 90 days; all qualifying equities and commodities, plus the 15 highest-volume crypto perps with at least one year of history. Liquidity correlates with past performance, so this favours assets that did well during the window (see Jiang et al. 2017, §3.1). For v2026.09, applying the same rule with only the first 30 days (2026-03-12 to 2026-04-10) selects 20 of the same 40 instruments: all 4 commodities, 10 of the 15 crypto perps (BCH, FIL, ONT, TAO and TRUMP instead of AAVE, LINK, NEAR, UNI and WLD), and 6 of the 21 equities (COIN, CRCL, HOOD, MSTR, NVDA, TSLA); most equity perps traded less than $1M a day in the weeks after listing. Instruments delisted before the scan are missing from both selections (survivorship). For backtests, split chronologically and report that the universe was chosen with information from the end of the window.
  • Corporate actions: prices are as traded. Several equity perps outside this universe (KORU, MUU, SPCX) show unadjusted 12-25x price breaks; the worst-hour column below lets you check that no instrument here has one.

Usage

import pandas as pd
from huggingface_hub import hf_hub_download
from okx_data.resample import resample_ohlcv

path = hf_hub_download("Torch-Trade/okx-multi-asset-1h", "ohlcv_1h.parquet", repo_type="dataset",
                       revision="v2026.09")  # pin a version; omit for the latest
bars = pd.read_parquet(path)
bars_4h = resample_ohlcv(bars, "4h")   # buckets 00:00, 04:00, ... UTC
bars_1d = resample_ohlcv(bars, "1D")   # any rule that divides a day works
close = bars.pivot(index="timestamp", columns="inst_id", values="close")

resample_ohlcv is in the TorchTrade portfolio-management repo; it takes first/max/min/last for open/high/low/close (and last for mark_close), sums volumes, and drops incomplete buckets.

Versions and getting more data

Each release is a git tag of this dataset named after the month of its last bar (vYYYY.MM). This is version v2026.09; older versions stay loadable with revision=<tag>, so results can always be reproduced.

The dataset is built by scripts/build_cross_asset_dataset.py in the TorchTrade portfolio-management repo, from free public OKX endpoints (no API key).

  • Newer data, same universe: rerun with a later end date, e.g. uv run python scripts/build_cross_asset_dataset.py --end 2026-12-01, and publish the result as a new tag (v2026.11) of this dataset.
  • Earlier data: not possible for the equity and commodity perps (they did not exist before their listing date). A crypto-only dataset can start as early as each coin's OKX history.
  • More instruments: OKX lists new perps regularly. scripts/scan_universe.py scans all live USDT instruments and reports history depth, liquidity and correlation; add qualifying names to the instrument lists at the top of the build script.
  • Finer resolution: 1-minute candles and tick-level trades are available from OKX's monthly archives (/api/v5/public/market-data-history, modules 2 and 1).
  • Delisting: if an instrument is delisted the build stops with an error rather than silently shrinking the universe.

Instruments

instrumentclasslisted on OKXmax leveragemean $vol/dayann volworst hour (log ret, mark)max |close/mark-1|funding interval h
CL-USDT-SWAPcommodity2026-03-0450101,295,9120.652026-04-07 22:00 (-0.095, -0.095)0.00344,8
NG-USDT-SWAPcommodity2026-03-10502,057,9110.442026-03-20 21:00 (-0.060, -0.060)0.00278
XAG-USDT-SWAPcommodity2026-01-285064,115,4730.532026-03-23 11:00 (+0.048, +0.049)0.00178
XAU-USDT-SWAPcommodity2025-04-09100250,101,9470.262026-03-23 00:00 (-0.023, -0.023)0.00118
AAVE-USDT-SWAPcrypto2020-12-105033,876,4700.792026-06-25 13:00 (-0.067, -0.065)0.00138
ADA-USDT-SWAPcrypto2020-02-285055,235,7530.722026-08-22 05:00 (-0.089, -0.089)0.00228
BNB-USDT-SWAPcrypto2022-12-235060,907,0990.402026-06-25 13:00 (-0.038, -0.038)0.00078
BTC-USDT-SWAPcrypto2019-11-121006,027,149,7880.392026-06-25 13:00 (-0.049, -0.049)0.00098
DOGE-USDT-SWAPcrypto2020-04-2150351,286,3900.602026-08-22 05:00 (-0.070, -0.071)0.00088
ETH-USDT-SWAPcrypto2019-11-121007,148,512,4570.532026-06-25 13:00 (-0.062, -0.062)0.00098
HYPE-USDT-SWAPcrypto2025-02-2150289,460,7590.842026-08-19 19:00 (+0.121, +0.122)0.00184,8
LINK-USDT-SWAPcrypto2020-02-285037,704,8840.602026-06-25 13:00 (-0.058, -0.058)0.00118
NEAR-USDT-SWAPcrypto2020-12-215050,970,7290.972026-08-22 05:00 (-0.080, -0.079)0.00218
PEPE-USDT-SWAPcrypto2023-05-0350129,821,4600.792026-08-20 08:00 (+0.071, +0.072)0.00218
SOL-USDT-SWAPcrypto2021-01-22100742,861,0350.572026-06-25 13:00 (-0.061, -0.061)0.00098
SUI-USDT-SWAPcrypto2023-05-055070,328,1990.742026-08-22 05:00 (-0.106, -0.107)0.00118
UNI-USDT-SWAPcrypto2020-09-175042,600,8160.862026-06-17 11:00 (-0.088, -0.087)0.00188
WLD-USDT-SWAPcrypto2023-07-2450119,825,9821.242026-06-05 02:00 (-0.120, -0.118)0.00248
XRP-USDT-SWAPcrypto2019-11-12100243,665,2470.572026-08-22 05:00 (-0.084, -0.085)0.00188
AAPL-USDT-SWAPequity2026-03-04205,208,7070.292026-07-30 20:00 (-0.048, -0.046)0.00568
AMD-USDT-SWAPequity2026-03-11257,360,8220.702026-08-04 20:00 (-0.093, -0.082)0.01148
AMZN-USDT-SWAPequity2026-02-26202,114,1170.352026-07-30 20:00 (+0.075, +0.077)0.00328
COIN-USDT-SWAPequity2026-02-26202,847,0410.722026-07-31 13:00 (-0.072, -0.072)0.00288
CRCL-USDT-SWAPequity2026-02-262522,767,4620.942026-03-24 14:00 (-0.098, -0.099)0.00228
EWY-USDT-SWAPequity2026-03-11508,061,8090.682026-07-29 19:00 (-0.061, -0.062)0.00638
GOOGL-USDT-SWAPequity2026-03-04504,550,6260.332026-04-29 20:00 (+0.054, +0.054)0.00438
HOOD-USDT-SWAPequity2026-02-25202,446,9410.732026-06-10 13:00 (+0.091, +0.091)0.00288
INTC-USDT-SWAPequity2026-02-262524,647,5920.872026-04-23 20:00 (+0.142, +0.143)0.00198
META-USDT-SWAPequity2026-03-04202,413,7860.422026-07-29 20:00 (-0.088, -0.090)0.00478
MSFT-USDT-SWAPequity2026-03-04202,927,7040.332026-07-29 22:00 (+0.055, +0.054)0.00558
MSTR-USDT-SWAPequity2026-02-252514,415,6170.812026-06-25 13:00 (-0.098, -0.098)0.00248
MU-USDT-SWAPequity2026-03-0450160,295,4170.912026-06-24 20:00 (+0.135, +0.136)0.00638
NVDA-USDT-SWAPequity2026-03-045013,839,8530.382026-06-25 13:00 (-0.049, -0.049)0.00118
ORCL-USDT-SWAPequity2026-03-11203,902,9960.622026-06-10 20:00 (-0.082, -0.076)0.00458
PLTR-USDT-SWAPequity2026-02-26202,043,7450.582026-08-03 20:00 (+0.111, +0.112)0.00158
QQQ-USDT-SWAPequity2026-03-04259,851,8580.222026-06-25 13:00 (-0.030, -0.030)0.00268
SNDK-USDT-SWAPequity2026-03-0475530,492,3021.092026-07-30 13:00 (+0.110, +0.110)0.00438
SPY-USDT-SWAPequity2026-03-04501,855,3560.152026-03-23 11:00 (+0.021, +0.019)0.00258
TSLA-USDT-SWAPequity2026-02-252511,460,6930.442026-07-23 13:00 (-0.056, -0.056)0.00138
TSM-USDT-SWAPequity2026-03-11202,142,0800.452026-06-25 13:00 (-0.050, -0.050)0.00248
finance
portfolio-management
torchtrade
trading

Contributors

torchtrade

4 commits