@pipeworx/okx
Connect: https://gateway.pipeworx.io/okx/mcp · Install: one-click buttons
Tools: 17
OKX v5 MCP — keyless public market endpoints.
Tools
instruments(instType, uly?, instFamily?, instId?)— list instruments (SPOT|MARGIN|SWAP|FUTURES|OPTION)ticker(instId)— single ticker (e.g.BTC-USDT)tickers(instType, uly?, instFamily?)— tickers by typeorder_book(instId, sz?)— orderbookcandles(instId, bar?, after?, before?, limit?)— OHLC (bar1m|3m|5m|15m|30m|1H|2H|4H|6H|12H|1D|1W|1M|3M)trades(instId, limit?)— recent tradesmarket_24hr(instId)— 24h tickerindex_tickers(quoteCcy?, instId?)— index tickersfunding_rate(instId)— current funding (perpetual swaps)funding_rate_history(instId, before?, after?, limit?)— historical fundingmark_price(instType, uly?, instId?)— mark priceperp_metrics(instId, period?, buckets?)— one call for funding rate + open interest + taker buy/sell (CVD) + long/short account ratioopen_interest(instId, instType?)— contracts outstanding, coin size, USD notionaltaker_volume(instId, period?, buckets?, unit?)— taker buy vs sell volume, buy/sell ratio and CVD across the windowlong_short_ratio(instId, period?, buckets?)— ratio of accounts long to accounts shorttime()— system timestatus()— system status
Data source
https://www.okx.com/api/v5/public and /market
Symbols
The four derivatives tools above accept a perpetual written in any common house
style — MASKUSDT (Binance style), MASK, MASK/USDT, MASK-USDT and
MASK-USDT-SWAP all resolve to the OKX contract MASK-USDT-SWAP. Every response
names the venue and the resolved instId, because a coin quoted on Binance or
Bybit is answered here with OKX’s own contract and the numbers differ between
venues. Binance’s perpetual endpoints refuse requests from Cloudflare egress
(403), so a Binance-specific taker buy/sell breakdown is not available from us.
An unknown contract comes back as {found: false, reason: "instrument_not_found"}
with the resolved instId and a hint, rather than an empty success — OKX itself
answers a bad instrument with HTTP 200 and code: "51001".
Column order (taker volume)
/rubik/stat/taker-volume-contract returns [ts, sellVol, buyVol] — sell first.
Verified 2026-08-22 by bucketing the live /market/trades tape for
MASK-USDT-SWAP into 5-minute bins and matching it against the endpoint
exactly. Reading the columns the other way round silently inverts the sign of CVD.
Tools
- 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.
- 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.
- 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 polygo
- 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.
- candles — OKX crypto exchange OHLC candles for a spot/perp/futures instrument. Bars 1m through 1M. Use for charting and backtesting OKX instruments.
- trades — OKX crypto exchange recent trade tape for an instrument. Returns price, size, side, timestamp. Use for tick-level execution analysis on OKX.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 ‘MASKU
- 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 ‘MAS
- 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
- 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
Tools
-
candles— OKX crypto exchange OHLC candles for a spot/perp/futures instrument. Bars 1m through 1M. Use for charting and backtesting OKX instruments. -
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. -
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. -
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. -
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. -
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 -
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. -
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. -
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 'MAS -
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. -
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 'MASKU -
status— OKX exchange system status — current operational state and any scheduled or ongoing maintenance windows affecting trading. -
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 -
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. -
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 -
time— OKX exchange server time in Unix milliseconds. Use to synchronise request timestamps or verify API connectivity. -
trades— OKX crypto exchange recent trade tape for an instrument. Returns price, size, side, timestamp. Use for tick-level execution analysis on OKX.