Use this skill when the user asks for: price of any asset, ticker, order book, candles, OHLCV, funding rate, open interest, OI change scanner, market screener (top movers, high-volume, newly listed), mark price, index price, recent trades, instrument list, stock tokens, metals prices (gold, XAU, XAG), commodities (oil, OIL), forex rates (EUR/USD, EURUSDT), bond instruments, non-crypto assets, or any technical indicator query (RSI, MACD, EMA, Bollinger Bands, KDJ, SuperTrend, AHR999, BTC rainbow, and 70+ more). All commands are read-only and do NOT require API credentials. Do NOT use for account balance/positions (okx-cex-portfolio), placing/cancelling orders (okx-cex-trade), or bots (okx-cex-bot).
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
okx-cex-market
description
Use this skill when the user asks for: price of any asset, ticker, order book, candles, OHLCV, funding rate, open interest, OI change scanner, market screener (top movers, high-volume, newly listed), mark price, index price, recent trades, instrument list, stock tokens, metals prices (gold, XAU, XAG), commodities (oil, OIL), forex rates (EUR/USD, EURUSDT), bond instruments, non-crypto assets, or any technical indicator query (RSI, MACD, EMA, Bollinger Bands, KDJ, SuperTrend, AHR999, BTC rainbow, and 70+ more). All commands are read-only and do NOT require API credentials. Do NOT use for account balance/positions (okx-cex-portfolio), placing/cancelling orders (okx-cex-trade), or bots (okx-cex-bot).
Compliance notice: This skill provides raw market data only. No strategy, recommendation, or optimization logic is embedded. All indicator outputs are objective numerical values; interpretation and trading decisions remain solely with the user.
Public market data for OKX: prices, order books, candles, funding rates, open interest, instrument info, and technical indicators. All commands are read-only and require no API credentials.
Skill routing
Market data / indicators → okx-cex-market (this skill)
Account balance / positions → okx-cex-portfolio
Place / cancel orders → okx-cex-trade
Grid / DCA bots → okx-cex-bot
Preflight
Before running any command, follow ../_shared/preflight.md.
Use metadata.version from this file's frontmatter as the reference for Step 2.
Market data commands return the same public data regardless of demo/live mode — no API credentials required. If the user's profile has demo=true set and they want live data context, they can use --live to confirm they are in live mode (it has no effect on public market data but clarifies environment). Always inform the user which environment is active (demo or live) when it is relevant to their query. No confirmation needed before running any market command. Add --json to any command for raw OKX API v5 response. Add --env to wrap the output as {"env", "profile", "data"}.
List instruments, discover stock tokens, metals/commodities/forex/bonds, find option instIds
{baseDir}/references/instrument-commands.md
Multi-step or cross-skill workflows; MCP tool names
{baseDir}/references/workflows.md
Step 2 — Run commands immediately
All market data commands are read-only — no confirmation needed.
Step 3 — No writes, no verification needed
All commands in this skill are read-only.
Edge Cases
instId format: SPOT BTC-USDT · SWAP BTC-USDT-SWAP · FUTURES BTC-USDT-250328 · OPTION BTC-USD-250328-95000-C · Index BTC-USD · Stock token TSLA-USDT-SWAP · Metals/Commodities/Forex/Bonds: use instruments-by-category to discover valid instIds first
OPTION listing: instruments --instType OPTION requires --uly BTC-USD; if unknown, run open-interest --instType OPTION first to discover active instIds
funding-rate / price-limit: SWAP only · mark-price: SWAP / FUTURES / OPTION only
candles --bar: uppercase — 1H not 1h; use --after <ts> to paginate back into historical data (back to 2021); index-candles supports --history for extended history
⚠️ Large historical range: before fetching with --after/--before, estimate candle count = time_range_ms / bar_interval_ms. If estimate > 500, tell the user the estimated count and ask for confirmation before proceeding. This prevents silently filling the context window.
indicator --bar: uses 1Dutc not 1D, 1Wutc not 1W — different from candle bar values
market filter ctType: linear or inverse (SWAP/FUTURES only); omit for SPOT
market filter quoteCcy: comma-separated list supported, e.g. --quoteCcy USDT,USDC
market filter SPOT + quoteCcy: when --instType SPOT, the API returns instruments across all quote currencies (USDT, USDC, BTC, ETH, etc.) mixed together — this pollutes sort order and bloats results. Always pass by default unless the user explicitly asks for other quote currencies.
Global Notes
No API key required for any command in this skill
Rate limit: 20 req / 2 s per IP
Candle data is sorted newest-first
vol24h is in base currency (e.g., BTC for BTC-USDT)
--demo/--live and --profile do not affect market data results via CLI (public endpoints); they only determine the active trading environment context
okx market stock-tokens
Deprecated — use instruments-by-category --instCategory 3 instead
Screen / rank instruments by multi-dimensional criteria (price, volume, OI, funding rate, market cap). Prints Total: N + a ranked table of matching instruments (No results only when nothing matches). Add --json for the raw OKX API v5 response (structurally unchanged).
Technical indicator values. For period-based indicators (ema/ma/wma/rsi/macd/bb/…) the CLI applies a sensible default period when --params is omitted (e.g. EMA/RSI → 14, MACD → 12,26,9, BB → 20,2) so values render without you specifying params; explicit --params always wins. If no values come back, the CLI prints a visible hint (try --params …) — never silent.
Spread statistics (abs + ratio: mean/stdDev/median/min/max) over a lookback window; supports backtest mode
--quoteCcy USDT
market filter chg24hPct: value is a percentage number — --minChg24hPct -5 means -5%, --maxChg24hPct 10 means 10%
market oi-history ts: Unix ms timestamp; returns bars with ts ≤ this value for historical pagination
market oi-history / oi-change bar: valid values 5m15m1H4H1D — default 1H. Server accepts case variants (1h == 1H) but prefer canonical casing.
market oi-history limit: 1–500 (default 50)
market oi-change instType: only SWAP or FUTURES supported (not SPOT)
market oi-change minAbsOiDeltaPct: filters by absolute OI change — 1.0 keeps only rows where |oiDeltaPct| ≥ 1%
market oi-change sortBy values: oiUsdoiDeltaUsdoiDeltaPctabsOiDeltaPctvolUsd24hfundingRatelast — default oiDeltaPct (signed). Use absOiDeltaPct to rank by |oiDeltaPct| (largest magnitude regardless of direction).
market oi-change limit: 1–100 (default 20). For deeper than 100 rows, fetch oi-history per instId.
indicator --bar valid values: 3m5m15m1H4H12Hutc1Dutc3Dutc1Wutc — 1m is not supported for indicators (use candles for 1-minute data)
indicator --limit: 1–100 (only used with returnList, i.e. when a historical series is requested)
indicator arg order: indicator name before instId — okx market indicator rsi BTC-USDT
indicator --params: comma-separated, no spaces — --params 5,20. For period-based indicators (ema/ma/wma/rsi/macd/bb/…) omitting --params makes the CLI substitute a default period (EMA/MA/WMA/RSI → 14, MACD → 12,26,9, BB → 20,2) so the table is populated instead of empty; pass --params explicitly to override the default. (CLI-only convenience — the MCP market_get_indicator raw-data path still requires an explicit paramList.)
indicator no values returned: the CLI never prints nothing — if a query yields no values (e.g. a non-period indicator, or a period indicator with no default), it prints a visible hint: No indicator values returned. This indicator may require a period — try --params (e.g. --params 14).
BTC-only indicators: ahr999, rainbow — BTC-USDT only
Unknown indicator name: returns a ValidationError with similar-name suggestions before the API is called — use market_list_indicators / okx market indicator list to see all valid names
Stock token hours: US stocks trade Mon–Fri ~09:30–16:00 ET; verify live price before acting
No data returned: instrument may be delisted — verify with okx market instruments