Okx Sentiment Tracker
dex-original/okx-agent-trade-kit
A skill your agent uses when the user asks about: 'any crypto news', 'latest news', 'market update', 'daily briefing', 'BTC news', 'ETH news', 'news on SOL', 'search SEC ETF', 'regulation news'…
Manage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁) on OKX.
$ npx skills add okx/agent-skills --skill okx-cex-bot -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install okx/agent-skills okx-cex-bot --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/okx-cex-bot .claude/skills/okx-cex-bot && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .claude/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-botType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add okx/agent-skills --skill okx-cex-bot -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install okx/agent-skills okx-cex-bot --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/okx-cex-bot .agents/skills/okx-cex-bot && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .agents/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add okx/agent-skills --skill okx-cex-bot -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install okx/agent-skills okx-cex-bot --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/okx-cex-bot .cursor/skills/okx-cex-bot && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .cursor/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/okx/agent-skills.git --path skills/okx-cex-bot--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add okx/agent-skills --skill okx-cex-bot -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install okx/agent-skills okx-cex-bot --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/okx-cex-bot .gemini/skills/okx-cex-bot && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .gemini/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install okx/agent-skills okx-cex-botInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add okx/agent-skills --skill okx-cex-bot -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/okx-cex-bot .github/skills/okx-cex-bot && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .github/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add okx/agent-skills --skill okx-cex-bot -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install okx/agent-skills okx-cex-bot --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/okx/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/okx-cex-bot .opencode/skills/okx-cex-bot && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "okx-cex-bot" agent skill from https://github.com/okx/agent-skills/tree/github-main/skills/okx-cex-bot into .opencode/skills/okx-cex-bot/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "okx-cex-bot", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
okx-cex-botManage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁) on OKX.
Okx Cex Bot is an agent skill from okx/agent-skills. Manage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁) on OKX. Covers create, stop, amend, monitor P&L, TP/SL, margin/investment adjustment, and AI-recommended parameters. Requires API credentials. Not for regular orders (okx-cex-trade), market data (okx-cex-market), or account info (okx-cex-portfolio).
Its SKILL.md is about 7.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Business, Finance & HR, covering Stock and market analysis. It works with OKX. The repository describes itself as: Plug-and-play AI agent skills for OKX — letting any LLM agent trade, manage portfolios, query live market data, and run grid/DCA bots through a single okx CLI, no API wiring… The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 9c180cc. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Okx Cex Bot loads about 7.5k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 2,799 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from okx/agent-skills at commit 9c180cc, republished under its MIT licence (© okx). 2,799 words, ~7,465 tokens.
.claude/skills/okx-cex-bot/SKILL.md (or your agent's skills folder).Grid and DCA (Spot & Contract Martingale) bot management on OKX. All bots are native OKX server-side — they run on OKX and do not require a local process.
Before running any command, follow ../_shared/preflight.md.
Use metadata.version from this file's frontmatter as the reference for Step 2.
npm install -g @okx_ai/okx-trade-cli
okx config init # select site -> follow browser OAuth flowSecurity: NEVER accept credentials in chat. Guide users to
okx config initfor setup.
Run before every authenticated command. The auth method is detected during preflight Step 2 and remembered for the session.
Run both commands — the apiKey field from okx auth status --json is the auth-binary's internal state and is always false regardless of whether ~/.okx/config.toml has an API-key profile. okx config show --json is the only authoritative source for API-key presence.
okx config show --json # reveals API-key profiles (TOML config)
okx auth status --json # reveals OAuth session state (auth-binary state)Apply in this order — first match wins:
config show --json has any profile with a non-empty api_key field → API Key mode. Proceed to Step B.auth status --json returns "status":"logged_in" → OAuth mode. Proceed to Step B."status":"pending" — login is in progress, wait for it to complete."status":"not_logged_in" — stop, load okx-cex-auth skill and follow login steps, wait for completion.Resolution:
How to apply the mode depends on auth method (detected in Step A):
| Auth method | Live (实盘) | Demo (模拟盘) |
|---|---|---|
| API Key | --profile <live-profile> | --profile <demo-profile> |
| OAuth | (no flag needed, live is default) | --demo |
okx config show --json to discover available profile names and their demo settings.--demo for simulated trading.After every command: append [mode: live] or [mode: demo]
Authentication error (error contains "401", "Session expired", or "Run okx auth login first"):
okx-cex-auth skill and follow re-authentication steps| Need | Skill |
|---|---|
| Market data, prices, depth | okx-cex-market |
| Account balance, positions, fees | okx-cex-portfolio |
| Regular spot/swap/futures orders | okx-cex-trade |
| Grid / DCA bots | okx-cex-bot (this skill) |
| Command | Type | Description |
|---|---|---|
okx bot grid create | WRITE | Create a grid bot (spot or contract) |
okx bot grid amend | WRITE | Amend price range, grid count, or TP/SL of a running grid bot |
okx bot grid stop | WRITE | Stop a grid bot |
okx bot grid positions | READ | Query open contract-grid positions (liquidation price, margin ratio, unrealized PnL) |
okx bot grid liquidate-price | READ | Estimate liquidation price for a contract-grid bot |
okx bot grid close-position | WRITE | Close remaining position after bot stopped with stopType=2 |
okx bot grid orders | READ | List active or history grid bots |
okx bot grid details | READ | Grid bot details + PnL |
okx bot grid sub-orders | READ | Individual grid fills or pending orders |
| Command | Type | Description |
|---|---|---|
okx bot dca create | WRITE | Create a DCA (Martingale) bot (spot or contract) |
okx bot dca stop | WRITE | Stop a DCA bot (spot or contract) |
okx bot dca orders | READ | List active or history DCA bots (default: contract_dca) |
okx bot dca details | READ | DCA bot details + PnL |
okx bot dca sub-orders | READ | DCA cycles and orders within a cycle |
Parse user request → determine module (Grid / DCA) and action (create / stop / list / details).
READ commands (orders, details, sub-orders): run immediately after profile confirmation.
WRITE commands (create, amend, stop): confirm key parameters with user once before executing.
orders command to confirm activebot grid details to confirm updated configorders --history to confirm stoppedalgoId is the bot's algo order ID (from create or list output). It is NOT a normal ordId. Never fabricate — always obtain from a prior command.algoOrdType for grid must match the bot's actual type. Always use the value from bot grid orders — do not infer from user description alone. Mismatch causes error 50016.tpTriggerPx/tpRatio and slTriggerPx/slRatio are mutually exclusive pairs.okx bot grid create --instId <id> --algoOrdType <type> \
--maxPx <px> --minPx <px> --gridNum <n> \
[--runType <1|2>] \
[--quoteSz <n>] [--baseSz <n>] \
[--direction <long|short|neutral>] [--lever <n>] [--sz <n>] \
[--basePos] [--no-basePos] \
[--tpTriggerPx <px>] [--slTriggerPx <px>] [--tpRatio <ratio>] [--slRatio <ratio>] \
[--algoClOrdId <id>] [--json]| Param | Required | Default | Description |
|---|---|---|---|
--instId | Yes | - | Instrument (e.g., BTC-USDT for spot, BTC-USDT-SWAP for USDT-M contract, BTC-USD-SWAP for coin-M contract) |
--algoOrdType | Yes | - | grid (spot grid) or contract_grid (contract grid, including coin-margined) |
--maxPx | Yes | - | Upper price boundary |
--minPx | Yes | - | Lower price boundary |
--gridNum | Yes | - | Grid levels (2–100) |
--runType | No | 1 | 1=arithmetic spacing, 2=geometric spacing |
--quoteSz | Cond. | - | USDT investment — spot grid only (provide quoteSz or baseSz) |
--baseSz | Cond. | - | Base currency investment — spot grid only |
--direction | Cond. | - | long, short, or neutral — required for contract grid |
--lever | Cond. | - | Leverage (e.g., 5) — contract grid only |
--sz | Cond. | - | Investment margin in USDT (USDT-M) or coin (coin-M) — contract grid only |
--basePos / --no-basePos | No | true | Open a base position at creation — contract grid only (ignored for neutral). Use --no-basePos to disable |
--tpTriggerPx | No | - | Take-profit trigger price (mutually exclusive with --tpRatio) |
--slTriggerPx | No | - | Stop-loss trigger price (mutually exclusive with --slRatio) |
--tpRatio | No | - | Take-profit ratio — contract grid only (mutually exclusive with --tpTriggerPx) |
--slRatio | No | - | Stop-loss ratio — contract grid only (mutually exclusive with --slTriggerPx) |
--algoClOrdId | No | - | Client-defined algo order ID (1-32 alphanumeric). Unique per user, enables idempotent creation |
okx bot grid amend --algoId <id> \
[--maxPx <px> --minPx <px> --gridNum <n>] \
[--instId <id>] \
[--tpTriggerPx <px>] [--slTriggerPx <px>] \
[--tpRatio <ratio>] [--slRatio <ratio>] \
[--topUpAmt <n>] [--json]Supports two modes that can be combined in one call:
Price-range mode — triggered when --maxPx is provided:
| Param | Required | Description |
|---|---|---|
--algoId | Yes | Grid bot algo order ID |
--maxPx | Yes | New upper price boundary |
--minPx | Yes (with maxPx) | New lower price boundary |
--gridNum | Yes (with maxPx) | New grid count (integer) |
--topUpAmt | No | Extra margin to add (contract grid only; omit to auto-use minimum required) |
TP/SL mode — triggered when at least one TP/SL param is provided; --instId is also required:
| Param | Required | Description |
|---|---|---|
--instId | Yes | Instrument ID (e.g., BTC-USDT) |
--tpTriggerPx | No | Take-profit trigger price (absolute). Pass -1 to clear |
--slTriggerPx | No | Stop-loss trigger price (absolute). Pass -1 to clear |
--tpRatio | No | Take-profit ratio (e.g., 0.1 = 10%). Contract grid only. Pass -1 to clear |
--slRatio | No | Stop-loss ratio (e.g., 0.1 = 10%). Contract grid only. Pass -1 to clear |
--topUpAmt | No | Extra margin to add (contract grid only) |
Note:
tpTriggerPx/tpRatioare mutually exclusive. Same forslTriggerPx/slRatio.
okx bot grid stop --algoId <id> --algoOrdType <type> --instId <id> \
[--stopType <1|2>] [--json]
--algoIdand--algoOrdTypemust come frombot grid ordersoutput. ThealgoOrdTypemust match the bot's actual type — do not guess.
Workflow:
bot grid details --algoId <id> --algoOrdType <type> and check the state field.state=running: call stop with --stopType 1 (default, clean exit) or --stopType 2 (keep assets).state=no_close_position (user previously stopped with stopType=2): call stop again with --stopType 1 to close the remaining open position.--stopType | Spot grid | Contract grid |
|---|---|---|
1 (default) | Sells all base assets back to quote | Market-closes all open positions |
2 | Keeps base assets as-is | Cancels grid orders, leaves position open |
okx bot grid positions --algoId <id> --algoOrdType contract_grid [--json]Returns open contract-grid positions: liquidation price (liqPx), margin ratio (mgnRatio), and unrealized PnL (upl). Only applicable to contract_grid bots.
okx bot grid liquidate-price --instId <id> --sz <margin> --lever <leverage> \
--maxPx <px> --minPx <px> --gridNum <n> --direction <long|short|neutral> \
[--runType <1|2>] [--triggerStrategy <instant|price|rsi|webhook>] [--json]Estimates the liquidation price for a contract-grid bot. Use before creating a bot to assess liquidation risk. The estimate needs the full intended config — the backend requires instId, sz, lever, the grid range (maxPx/minPx/gridNum) and direction (use neutral for a neutral bot); omitting any of them fails fast with the list of what's missing. runType defaults to 1 (arithmetic; 2=geometric) and triggerStrategy is optional.
okx bot grid close-position --algoId <id> (--mktClose | --no-mktClose) [--sz <size>] [--px <price>] [--json]Closes the remaining open position of a contract-grid bot that was stopped with stopType='2'. The close mode is required (no default, because it moves funds): pass --mktClose for a market close (immediate), or --no-mktClose --sz <size> --px <price> for a limit close order. Omitting both is rejected.
okx bot grid orders --algoOrdType <type> [--instId <id>] [--algoId <id>] [--history] [--json]| Param | Required | Default | Description |
|---|---|---|---|
--algoOrdType | Yes | - | grid (spot), contract_grid (contract), or moon_grid (moon) |
--instId | No | - | Filter by instrument |
--algoId | No | - | Filter by algo order ID. NOT a normal trade order ID |
--history | No | false | Show completed/stopped bots instead of active |
okx bot grid details --algoOrdType <type> --algoId <id> [--json]Returns: bot config, current PnL (pnlRatio), grid range, number of grids, state, position info.
okx bot grid sub-orders --algoOrdType <type> --algoId <id> [--pending] [--groupId <id>] [--after <id>] [--before <id>] [--limit <n>] [--json]| Flag | Effect |
|---|---|
| (default) | Filled sub-orders (executed grid trades) |
--pending | Pending grid orders currently on the book. (Works in demo mode. --live is a deprecated alias and cannot be combined with --demo.) |
--groupId | Filter to one buy-sell pair (shared groupId) |
--after | Pagination cursor — records older than this id |
--before | Pagination cursor — records newer than this id |
--limit | Max records to return (default 100) |
okx bot dca create --algoOrdType <spot_dca|contract_dca> --instId <id> --direction <long|short> \
--initOrdAmt <n> --maxSafetyOrds <n> --tpPct <ratio> \
[--lever <n>] [--safetyOrdAmt <n>] [--pxSteps <ratio>] [--pxStepsMult <mult>] [--volMult <mult>] \
[--slPct <ratio>] [--slMode <limit|market>] [--allowReinvest] \
[--triggerStrategy <instant|price|rsi>] [--triggerPx <price>] \
[--triggerCond <cross_up|cross_down>] [--thold <threshold>] [--timeframe <timeframe>] [--timePeriod <period>] \
[--algoClOrdId <id>] [--reserveFunds <true|false>] [--tradeQuoteCcy <ccy>] [--json]| Param | Required | Default | Description |
|---|---|---|---|
--algoOrdType | Yes | - | spot_dca (Spot DCA) or contract_dca (Contract DCA) |
--instId | Yes | - | Instrument (e.g., BTC-USDT for spot, BTC-USDT-SWAP for contract) |
--lever | Cond. | - | Leverage multiplier (e.g., 3). Required for contract_dca |
--direction | Yes | - | long or short. spot_dca must be long |
--initOrdAmt | Yes | - | Initial order amount (quote currency) |
--maxSafetyOrds | Yes | - | Max safety orders, integer [0, 100] (e.g., 3; 0 = no DCA) |
--safetyOrdAmt | Cond. | - | Safety order amount (quote currency). Required when maxSafetyOrds > 0 |
--pxSteps | Cond. | - | Initial price deviation [0.001, 0.5], e.g., 0.03 = 3%. Required when maxSafetyOrds > 0 |
--pxStepsMult | Cond. | 1 | Price step multiplier (e.g., 1.2). Required when maxSafetyOrds > 0 |
--volMult | Cond. | 1 | Safety order size multiplier (e.g., 1.5). Required when maxSafetyOrds > 0 |
--tpPct | Yes | - | Take-profit ratio: long [0.001, 10], short [0.001, 0.9999] (e.g., 0.03 = 3%) |
--slPct | No | - | Stop-loss ratio, must exceed MPD (e.g., 0.05 = 5%). Must be used with --slMode |
--slMode | No | market | Stop-loss type: limit or market. Must be used with --slPct |
--allowReinvest | No | true | Reinvest profit into the next DCA cycle |
--triggerStrategy | No | instant | contract_dca: instant, price, rsi; spot_dca: instant, rsi |
--triggerPx | No | - | Trigger price — required when triggerStrategy=price (contract_dca only) |
--triggerCond | No | - | cross_up or cross_down — required when triggerStrategy=rsi, optional when triggerStrategy=price |
--thold | No | - | RSI threshold (e.g. 30) — required when triggerStrategy=rsi |
--timeframe | No | - | RSI timeframe (e.g. 15m) — required when triggerStrategy=rsi |
--timePeriod | No | 14 | RSI period — optional when triggerStrategy=rsi |
--algoClOrdId | No | - | Client-defined strategy order ID (1-32 alphanumeric) |
--reserveFunds | No | true | true or false — whether to reserve funds |
--tradeQuoteCcy | No | - | Trade quote currency |
Conditional required logic:
--algoOrdType, --instId, --direction, --initOrdAmt, --maxSafetyOrds, --tpPctalgoOrdType=contract_dca: also required --levermaxSafetyOrds > 0: also required --safetyOrdAmt, --pxSteps, --pxStepsMult, --volMult--slPct and --slMode must be both set or both omittedokx bot dca stop --algoOrdType <spot_dca|contract_dca> --algoId <id> [--stopType <1|2>] [--json]Workflow:
bot dca details --algoId <id> --algoOrdType <type> and check the state field.state=running: call stop (with --stopType for spot_dca).state=no_close_position (user previously stopped with stopType=2): call stop again with --stopType 1 to close the remaining open position.| Param | Required | Default | Description |
|---|---|---|---|
--algoOrdType | Yes | - | spot_dca or contract_dca |
--algoId | Yes | - | DCA bot algo order ID (from create or list output). NOT a normal trade order ID |
--stopType | Cond. | 1 | spot_dca required: 1=sell all tokens, 2=keep tokens. contract_dca: 1=close position (default), 2=keep position open |
okx bot dca orders [--algoOrdType <spot_dca|contract_dca>] [--algoId <id>] [--instId <id>] [--history] [--json]| Param | Required | Default | Description |
|---|---|---|---|
--algoOrdType | No | contract_dca | Filter by strategy type |
--algoId | No | - | Filter by DCA bot algo order ID |
--instId | No | - | Filter by instrument |
--history | No | false | Show completed/stopped bots instead of active |
okx bot dca details --algoOrdType <spot_dca|contract_dca> --algoId <id> [--json]Returns: avgPx, upl, liqPx, sz, tpPx, slPx, initPx, fundingFee, fee, fillSafetyOrds, algoClOrdId, baseSz, quoteSz, tradeQuoteCcy.
okx bot dca sub-orders --algoOrdType <spot_dca|contract_dca> --algoId <id> [--cycleId <id>] [--after <id>] [--before <id>] [--limit <n>] [--json]| Flag / Param | Effect |
|---|---|
| (default) | List all cycles |
--cycleId <id> | Show orders within a specific cycle |
# Spot grid: BTC $90k–$100k, 10 grids, 1000 USDT
okx bot grid create --instId BTC-USDT --algoOrdType grid \
--minPx 90000 --maxPx 100000 --gridNum 10 --quoteSz 1000
# Contract grid: BTC perp, neutral, 5x, 100 USDT margin
okx bot grid create --instId BTC-USDT-SWAP --algoOrdType contract_grid \
--minPx 90000 --maxPx 100000 --gridNum 10 \
--direction neutral --lever 5 --sz 100
# Coin-margined contract grid: BTC inverse perp
okx bot grid create --instId BTC-USD-SWAP --algoOrdType contract_grid \
--minPx 90000 --maxPx 100000 --gridNum 10 \
--direction long --lever 5 --sz 0.01
# Contract DCA bot: BTC perp, long, 3x, 3% TP
okx bot dca create --algoOrdType contract_dca --instId BTC-USDT-SWAP --lever 3 --direction long \
--initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \
--pxSteps 0.03 --pxStepsMult 1 --volMult 1 --tpPct 0.03
# Spot DCA bot: BTC spot, long, 5% TP
okx bot dca create --algoOrdType spot_dca --instId BTC-USDT --direction long \
--initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \
--pxSteps 0.03 --pxStepsMult 1.2 --volMult 1.5 --tpPct 0.05
# Amend grid price range
okx bot grid amend --algoId 3486105572796182528 --maxPx 102000 --minPx 88000 --gridNum 14
# Amend grid TP/SL
okx bot grid amend --algoId 3486105572796182528 --instId BTC-USDT --tpTriggerPx 110000 --slTriggerPx 80000
# Amend both in one call (combined mode)
okx bot grid amend --algoId 3486105572796182528 \
--maxPx 102000 --minPx 88000 --gridNum 14 \
--instId BTC-USDT --tpTriggerPx 110000 --slTriggerPx 80000
# Clear TP/SL (use =-1 syntax for negative values)
okx bot grid amend --algoId 3486105572796182528 --instId BTC-USDT --tpTriggerPx=-1 --slTriggerPx=-1
# List all active bots
okx bot grid orders --algoOrdType grid
okx bot grid orders --algoOrdType contract_grid
okx bot dca orders --algoOrdType contract_dca
okx bot dca orders --algoOrdType spot_dcaUser: "Start a BTC grid bot between $90k and $100k with 10 grids, invest 1000 USDT"
1. okx-cex-market okx market ticker BTC-USDT → confirm price is in range
2. okx-cex-portfolio okx account balance USDT → confirm available funds
↓ user approves
3. okx-cex-bot okx bot grid create --instId BTC-USDT --algoOrdType grid \
--minPx 90000 --maxPx 100000 --gridNum 10 --quoteSz 1000
4. okx-cex-bot okx bot grid orders --algoOrdType grid → confirm bot is active
5. okx-cex-bot okx bot grid details --algoOrdType grid --algoId <id> → monitor PnLUser: "Start a long DCA bot on BTC perp, 3x leverage, $200 initial, 3% TP"
1. okx-cex-market okx market ticker BTC-USDT-SWAP → confirm current price
2. okx-cex-portfolio okx account balance USDT → confirm margin
↓ user approves
3. okx-cex-bot okx bot dca create --algoOrdType contract_dca --instId BTC-USDT-SWAP \
--lever 3 --direction long \
--initOrdAmt 200 --safetyOrdAmt 100 --maxSafetyOrds 3 \
--pxSteps 0.03 --pxStepsMult 1 --volMult 1 --tpPct 0.03
4. okx-cex-bot okx bot dca orders --algoOrdType contract_dca → confirm active
5. okx-cex-bot okx bot dca details --algoOrdType contract_dca --algoId <id> → monitor PnLUser: "帮我在现货上 DCA BTC,首单 100 USDT,5% 止盈"
1. okx-cex-market okx market ticker BTC-USDT → confirm current price
2. okx-cex-portfolio okx account balance USDT → confirm funds
↓ user approves
3. okx-cex-bot okx bot dca create --algoOrdType spot_dca --instId BTC-USDT \
--direction long \
--initOrdAmt 100 --safetyOrdAmt 50 --maxSafetyOrds 3 \
--pxSteps 0.03 --pxStepsMult 1.2 --volMult 1.5 --tpPct 0.05
4. okx-cex-bot okx bot dca orders --algoOrdType spot_dca → confirm active--minPx must be < current price < --maxPx; check with okx-cex-market firstokx-cex-portfolio → account balance before creating. If insufficient, do NOT auto-transfer — report the shortfall and ask the user for instructionslong (buys more at lower prices), short (sells at higher), neutral (both). Direction is required for contract gridtrue — long/short grids automatically open a base position at creation. Neutral direction ignores this. Pass --no-basePos to disableBTC-USD-SWAP). Margin unit is the base coin (BTC), not USDTstopType 1 sells/closes all (default); stopType 2 keeps assets as-is (spot grid) or leaves position open for manual close (contract grid)tpTriggerPx/tpRatio and slTriggerPx/slRatio are mutually exclusive pairs. Ratio-based TP/SL is contract grid only--maxPx+--minPx+--gridNum) or TP/SL params; providing neither returns a validation error--tpTriggerPx=-1 or --slTriggerPx=-1 (use = syntax for negative values, not --flag -1)--topUpAmt; omit to auto-use the minimum required--topUpAmt for spot gridsbot grid orders --history first to confirm stateokx-cex-portfolio, report shortfall to user — do NOT auto-transferokx --demo bot grid create ... (OAuth) or okx --profile <demo-profile> bot grid create ... (API Key) — safe for testing, no real fundsalgoClOrdId already exists, the API returns error code 51065long. If user says "short spot DCA", explain that spot DCA only supports long direction1) or keep them (2) when stopping1.0 = equal spacing; >1.0 = widen gaps between successive safety orders1.0 = equal sizes; >1.0 = increase per safety order (Martingale scaling)instant starts immediately; price waits for trigger price (contract_dca only); rsi waits for RSI condition (both spot_dca and contract_dca)bot dca orders --history firstokx --demo bot dca create ... (OAuth) or okx --profile <demo-profile> bot dca create ... (API Key) — safe testing, no real fundsslPct. Recalculate MPD = Σ(pxSteps × pxStepsMult^i) for i = 0..maxSafetyOrds−1, then set slPct > MPD51065
{base}and{quote}: extract frominstIdby splitting on-. E.g.,BTC-USDT-SWAP→ base=BTC, quote=USDT.
algoOrdType=grid)| API Field | EN | ZH |
|---|---|---|
instId | Trading pair | 交易对 |
minPx | Lower price bound | 网格下限价格 |
maxPx | Upper price bound | 网格上限价格 |
gridNum | Number of grids | 网格数量 |
quoteSz | Investment amount ({quote}) | 投入金额({quote}) |
baseSz | Investment amount ({base}) | 投入金额({base}) |
runType | Spacing mode (1=arithmetic, 2=geometric) | 网格间距模式(1=等差, 2=等比) |
stopType | Stop behavior | 停止方式 |
algoOrdType=contract_grid)| API Field | EN | ZH |
|---|---|---|
instId | Trading pair | 交易对 |
minPx | Lower price bound | 网格下限价格 |
maxPx | Upper price bound | 网格上限价格 |
gridNum | Number of grids | 网格数量 |
sz | Investment margin (USDT for USDT-M; {base} for coin-M) | 投入保证金(USDT-M 为 USDT;币本位为 {base}) |
direction | Direction (long / short / neutral) | 方向(做多 / 做空 / 中性) |
lever | Leverage | 杠杆倍数 |
runType | Spacing mode (1=arithmetic, 2=geometric) | 网格间距模式(1=等差, 2=等比) |
basePos | Open base position | 是否开底仓 |
stopType | Stop behavior | 停止方式 |
| API Field | EN | ZH |
|---|---|---|
algoOrdType | Strategy type (spot/contract) | 策略类型(现货/合约) |
instId | Trading pair | 交易对 |
initOrdAmt | Initial order amount ({quote}) | 首单金额({quote}) |
safetyOrdAmt | Safety order amount ({quote}) | 补仓金额({quote}) |
maxSafetyOrds | Max safety orders | 最大补仓次数 |
pxSteps | Price drop per safety order (%) | 补仓价格跌幅(%) |
pxStepsMult | Price step multiplier | 补仓跌幅倍数 |
volMult | Safety order size multiplier | 补仓金额倍数 |
tpPct | Take-profit ratio (%) | 止盈比例(%) |
slPct | Stop-loss ratio (%) | 止损比例(%) |
slMode | Stop-loss type (limit/market) | 止损类型(限价/市价) |
lever | Leverage | 杠杆倍数 |
direction | Direction (long/short) | 方向(做多/做空) |
allowReinvest | Reinvest profit | 利润再投入 |
triggerStrategy | Trigger mode (contract_dca: instant/price/rsi; spot_dca: instant/rsi) | 触发方式 |
triggerPx | Trigger price | 触发价格 |
algoClOrdId | Client order ID | 客户端策略订单 ID |
stopType | Stop type (sell all / keep tokens) | 停止类型(卖出/保留) |
reserveFunds | Reserve funds | 预留资金 |
slPctstop-loss logic:
- Long: stop-loss price = initial fill price × (1 − slPct)
- Short: stop-loss price = initial fill price × (1 + slPct) When triggered and position fully closed, the bot ends.
--json returns the raw OKX API v5 response by default. Add --env to wrap the output as {"env": "<live|demo>", "profile": "<name>", "data": <response>}--gridNum range: 2–100© okx, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/okx-cex-bot of okx/agent-skills.
Open the folder on GitHubat commit 9c180cc
We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in okx/agent-skills, which our catalogue first saw on October 7, 2026.
Okx Cex Bot next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Okx Cex Bot this skillokx/agent-skills | 186 | 3 repos | ~7.5k | Automated safety check: Pass | MIT | |
| Okx Sentiment Trackerdex-original/okx-agent-trade-kit | 110 | 1 repos | ~3.8k | Automated safety check: Pass | MIT | |
| Okx Dex MarketLeoYeAI/openclaw-master-skills | 2.2k | — | ~5.9k | Automated safety check: Notes | MIT | |
| Vibe-Trading Finance ToolkitHKUDS/Vibe-Trading | 35k | — | ~6.5k | Automated safety check: Pass | MIT | |
| Minute-Level Data and BacktestingHKUDS/Vibe-Trading | 35k | — | ~868 | Automated safety check: Pass | MIT | |
| Market Data Source RouterHKUDS/Vibe-Trading | 35k | — | ~2.4k | Automated safety check: Pass | MIT |
dex-original/okx-agent-trade-kit
A skill your agent uses when the user asks about: 'any crypto news', 'latest news', 'market update', 'daily briefing', 'BTC news', 'ETH news', 'news on SOL', 'search SEC ETF', 'regulation news'…
LeoYeAI/openclaw-master-skills
A skill your agent uses for on-chain market data: token prices/价格, K-line/OHLC charts, index prices, and wallet PnL/盈亏分析 (win rate, my DEX trade history, realized/unrealized PnL per token).
HKUDS/Vibe-Trading
Finance research toolkit with backtesting, factor analysis, a library of prebuilt alphas, options pricing and a Shadow Account loop that tests rules extracted from your trade journal.
HKUDS/Vibe-Trading
Fetches minute candlesticks from OKX, Tushare or yfinance, computes intraday VWAP, TWAP and volume distribution, and runs minute-level backtests by setting an interval in config.json.
HKUDS/Vibe-Trading
Maps backtest data sources and research data needs to the right provider or tool, with each one's markets, required environment keys and network constraints.
zhangxiangliang/stock-api
Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.
okx/agent-skills
Manages OKX Simple Earn (flexible savings/lending), Flash Earn, On-chain Earn (staking/DeFi), Dual Investment (DCD/双币赢), and AutoEarn (自动赚币) via the okx CLI.
okx/agent-skills
Automatically monitors OKX Flash Earn, Fixed Earn and Flexible Earn opportunities, sends push notifications, and guides subscription.
okx/agent-skills
A skill your agent uses when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up credentials', 'first time setup', 'configure okx', '登录', '授权'…
okx/agent-skills
A skill your agent uses 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…
okx/agent-skills
A skill your agent uses when the user asks to: 'find a trading skill', 'search for skills', 'install a skill', 'add a skill', 'download a skill', 'browse skill marketplace', 'what skills are…
okx/agent-skills
Smart Money analytics on OKX: leaderboard traders, position tracking, trade records, closed-position history, aggregated consensus signals, and signal history.
Works with
Categories
Manage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁) on OKX. Okx Cex Bot is an agent skill from okx/agent-skills. Manage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁) on OKX.
Okx Cex Bot fits situations like: tasks that involve Stock and market analysis.
Run `npx skills add okx/agent-skills --skill okx-cex-bot -a claude-code`. Or copy the skill folder (skills/okx-cex-bot in okx/agent-skills) into .claude/skills/okx-cex-bot in your project. Claude Code loads it when a task matches its description.
Run `npx skills add okx/agent-skills --skill okx-cex-bot -a codex`. Or copy the skill folder (skills/okx-cex-bot in okx/agent-skills) into .agents/skills/okx-cex-bot in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add okx/agent-skills --skill okx-cex-bot -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/okx-cex-bot, .gemini/skills/okx-cex-bot, .github/skills/okx-cex-bot and .opencode/skills/okx-cex-bot in your project.
Going by SKILL.md and its folder, Okx Cex Bot needs the command-line tools its instructions call (npm). Our summary lists: Node.js.
SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Okx Cex Bot is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 7.5k tokens (SKILL.md is roughly 30k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Okx Cex Bot: Okx Sentiment Tracker (dex-original/okx-agent-trade-kit, 110 stars), Okx Dex Market (LeoYeAI/openclaw-master-skills, 2.2k stars), Vibe-Trading Finance Toolkit (HKUDS/Vibe-Trading, 35k stars) and Minute-Level Data and Backtesting (HKUDS/Vibe-Trading, 35k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
okx (a GitHub organization) maintains it in okx/agent-skills, which has 186 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on September 23, 2026.
Source: okx/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.