OKX CSV export format

parser live
🔒 CSV conversion runs in your browser — files are not uploaded

This is the format reference for OKX CSV export (trading history / funding account) — where the file comes from, what each column means, and the export quirks that matter. Our parser reads the layout(s) below and converts it in your browser.

Layout evidence: Layouts per BittyTax’s okx.py and OKX help-center export docs — see research/parser-fixture-validation-2026-10.md.

How to export the file

  1. OKX → Order Center → Trading history → Download (this is the two-row-per-trade file the converter reads).
  2. For funding events: account/bills export → Download.
  3. Do NOT use Order Center → Order history for conversion — see the quirks below.

Column reference

Trading history (transaction history)

ColumnWhat it means
idEvent id — the join key: each spot trade is TWO rows sharing this id.
Order idBacking order id (fallback grouping key).
TimeEvent timestamp.
Trade TypeRow class — "Transfer" rows are internal moves.
InstrumentPair/instrument code.
TypeBuy or Sell — each trade has one of each row.
AmountThis row’s leg quantity.
Unit (first)Currency of THIS row’s Amount — there are two columns named "Unit"; the first is used positionally.
PLProfit/loss field.
FeeFee — sits on the Buy row in the bought currency, negative-signed.
Position Change / Position Balance / Balance Change / Balance / Unit (second)Position and balance bookkeeping columns.

Funding / account bills

ColumnWhat it means
idEvent id.
TimeEvent timestamp.
TypeDeposit, Withdrawal, Staking Yield, Fee rebate, Stake, Redeem staking, Savings moves, …
AmountSigned quantity — negative on withdrawals.
Before Balance / After BalanceBalance bookkeeping.
FeeFee amount.
SymbolAsset.

Order history — recognized but refused

Order Center → Order history export. States only one leg per order; converting would mean guessing the counter-leg from a price, which the parser refuses to do.

ColumnWhat it means
Order ID / Order TimeOrder identifiers and time.
Instrument / SymbolPair codes.
Side / Order Type / Order Amount / Filled Amount / Amount UnitOrder parameters — one leg only.
Order Price / Avg. Filled Price / Price UnitPrice fields — the counter-leg exists only implicitly.
PNL / Fee / Fee Unit / Status / Bot IDFill bookkeeping.

Format quirks

Convert this file (2)

Convert an OKX CSV to the Koinly formatlive
Convert an OKX CSV to CoinTrackerlive

All OKX CSV converters · Format reference index · All converters