Skip to main content

OKX

OKX Market Data Connector

OKX Data Connector based on WebSocket/REST.

Configuration

Data Connector Parameters

ParameterDefault ValueDescription
WebSocket URLwss://ws.okx.com:8443/ws/v5/publicWebSocket root URL.

The following endpoints are supported:

Standard OKX data feed:
wss://ws.okx.com:8443/ws/v5/public

OKX AWS data feed:
wss://wsaws.okx.com:8443/ws/v5/public

By default URL for standard OKX data feed is chosen.
REST URLhttps://www.okx.com/REST root URL.

The following endpoints are supported:

Standard OKX endpoint:
https://www.okx.com/

OKX AWS endpoint:
https://aws.okx.com/

By default URL for standard OKX endpoint is chosen.
Read Timeout20000Read timeout in milliseconds.
Reconnect Timeout15000Reconnect timeout in milliseconds.
Exchange NameOKXExchange name for this session.
Use Tick-By-Tick Order Book ChannelfalseThis option allows to use tick-by-tick order book channel instead of a standard one.

Supported tick-by-tick order book channels: books50-l2-tbt (50 levels) and books-l2-tbt (400 levels).
Depending on Output Book Size value either books50-l2-tbt or books-l2-tbt order book channel will be used.

Default value for this option is false.
API KeyN/AAPI key for authentication in OKX.
Secret KeyN/ASecret key for authentication in OKX.
PassphraseN/APassphrase for authentication in OKX.
Output Book Size20Size of the output book.
Snapshot Interval10SThis property sets an interval in seconds between periodical Level2 snapshots which sent to Aggregator.

Snapshots will be generated as soon as this threshold is exceeded AND the next increment message arrives. Conversely, snapshots are NOT generated every period if no data is coming in.

Default value is 10 seconds.

Symbology

Supported symbol notations:

Symbol NotationExamples
SYMBOL-NAMEBTC-USDT BTC-USD-SWAP BTC-USD-231103

To get full symbol list please refer:

https://www.okex.com/api/v5/public/instruments?instType=SPOT

https://www.okex.com/api/v5/public/instruments?instType=SWAP

https://www.okex.com/api/v5/public/instruments?instType=FUTURES