Okx
v0.2.1OKX v5 public MCP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
instruments
OKX crypto exchange — list instruments by type: 'SPOT', 'MARGIN', 'SWAP', 'FUTURES', or 'OPTION'. Returns instrument IDs, tick sizes, lot sizes, and trading rules for each.
| Parameter | Type | Description |
|---|---|---|
instType * | string | |
instFamily | string | |
instId | string | |
uly | string |
ticker
OKX crypto exchange — single instrument ticker (e.g. "BTC-USDT", "BTC-USD-SWAP"). Returns bid/ask, last, 24h vol/change. Use for current pricing of an OKX-listed instrument.
| Parameter | Type | Description |
|---|---|---|
instId * | string |
tickers
OKX crypto exchange — bulk tickers by instrument type ("SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"). Use to enumerate all spot or all perp instruments. NOT a general stock-ticker search — use polygon-io/tickers for that.
| Parameter | Type | Description |
|---|---|---|
instType * | string | |
instFamily | string | |
uly | string |
order_book
OKX crypto exchange order book (bids + asks) for a spot/perp/futures instrument. Use for live depth-of-book on OKX-listed instruments.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
sz | number |
candles
OKX crypto exchange OHLC candles for a spot/perp/futures instrument. Bars 1m through 1M. Use for charting and backtesting OKX instruments.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
after | string | |
bar | string | |
before | string | |
limit | number |
trades
OKX crypto exchange recent trade tape for an instrument. Returns price, size, side, timestamp. Use for tick-level execution analysis on OKX.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
limit | number |
market_24hr
OKX crypto exchange 24-hour rolling stats for an instrument: open, high, low, last, volume, vol-ccy. Use for daily summary on OKX.
| Parameter | Type | Description |
|---|---|---|
instId * | string |
index_tickers
OKX crypto exchange index tickers — current index price and 24h change for OKX index instruments. Filter by quote currency (e.g. 'USD') or specific instId.
| Parameter | Type | Description |
|---|---|---|
instId | string | |
quoteCcy | string |
funding_rate
OKX crypto exchange current perpetual swap funding rate for a SWAP instrument (e.g. 'BTC-USDT-SWAP'): funding rate, next settlement time, and method.
| Parameter | Type | Description |
|---|---|---|
instId * | string |
funding_rate_history
OKX crypto exchange historical perpetual swap funding rates for a SWAP instrument (e.g. 'BTC-USDT-SWAP'). Optional before/after (ms epoch) cursors and limit. Use for funding cost analysis.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
after | string | |
before | string | |
limit | number |
mark_price
OKX crypto exchange mark price for derivatives: pass instType (e.g. 'SWAP') and optionally uly or instId. Returns the mark price used for unrealised P&L and liquidation calculations.
| Parameter | Type | Description |
|---|---|---|
instType * | string | |
instId | string | |
uly | string |
time
OKX exchange server time in Unix milliseconds. Use to synchronise request timestamps or verify API connectivity.
status
OKX exchange system status — current operational state and any scheduled or ongoing maintenance windows affecting trading.
perp_metrics
Crypto perpetual futures snapshot in one call: funding rate, open interest, taker buy/sell volume (CVD) and long/short account ratio for a perpetual swap. Accepts exchange-style symbols such as 'MASKUSDT', 'MASK' or 'MASK-USDT-SWAP'. Figures come from the OKX venue and the response states that venue, so a symbol quoted on Binance or Bybit is answered with OKX's own contract for that coin, labelled as such.
| Parameter | Type | Description |
|---|---|---|
instId * | string | Perpetual symbol — 'MASKUSDT', 'MASK', 'MASK-USDT' and 'MASK-USDT-SWAP' all resolve to the same OKX contract. |
buckets | number | How many recent buckets of taker flow to sum for CVD. Default 24, max 100. |
period | string | Bucket size for taker flow and long/short ratio: 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D. Default 5m. |
open_interest
Open interest for a crypto perpetual swap or dated futures contract on the OKX venue — contracts outstanding, coin-denominated size and USD notional, with timestamp. Accepts 'MASKUSDT', 'MASK' or 'MASK-USDT-SWAP'. Use to size how much leverage is riding on a perp.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
instType | string | SWAP (default), FUTURES or OPTION. |
taker_volume
Taker buy versus taker sell volume for a crypto perpetual contract on the OKX venue, bucketed by period. Returns the per-bucket series, the buy/sell ratio and cumulative volume delta (CVD) across the window — the aggressor-flow input for order-flow and CVD analysis.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
buckets | number | Recent buckets to return and sum. Default 24, max 100. |
period | string | 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H or 1D. Default 5m. |
unit | string | '0' for contracts (default), '1' for coin. |
long_short_ratio
Long/short account ratio for a crypto perpetual contract on the OKX venue — the ratio of accounts holding longs to accounts holding shorts, bucketed by period. A value above 1 means more accounts sit long. Use for positioning and crowd-sentiment reads on a perp.
| Parameter | Type | Description |
|---|---|---|
instId * | string | |
buckets | number | Recent buckets to return. Default 24, max 100. |
period | string | 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H or 1D. Default 5m. |