okx-cex-bot Skill (OKX) for Claude: What It Does and How to Install It
Lets Claude create, amend, stop and monitor OKX grid bots, DCA Martingale bots and Smart Portfolio bots.
- Installs
- 10K
- on skills.sh
- Stars
- 200
- on GitHub
- Files
- 4
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
Ask Claude to create a grid bot, a spot or contract DCA Martingale bot, or a Smart Portfolio bot, and it runs the matching okx CLI command. It can also amend, stop, and monitor P&L, margin and TP/SL on a running bot, and read OKX-recommended parameters and backtests.
SKILL.md says every bot runs natively on OKX's own servers, not as a local process, so a bot keeps running after your chat session ends. Creating or changing a bot needs OKX API-key or OAuth credentials and the trading mode confirmed first, the same as the other authenticated OKX skills.
Good for
- People who want an OKX grid or DCA bot set up by chatting
- Traders monitoring bot P&L, margin and TP/SL without opening the app
- Anyone rebalancing a multi-asset Smart Portfolio bot on OKX
Install okx-cex-bot
Claude Code
- 1
Copy this prompt.
Install the okx-cex-bot skill in Claude Code. Run this command: npm install -g @okx_ai/okx-trade-cli Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
This skill does nothing without the okx CLI, so install it first. It needs OKX API credentials or an OAuth login, which the sibling okx-cex-auth skill sets up: run its steps, or okx config init, before using this skill.
From the project README. Source.
What's in the skill
When it loads
Manage Grid bots (spot/contract/coin-margined), DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁), and Smart Portfolio bots (智能组合, auto-rebalancing multi-asset portfolio) on OKX. Covers create, stop, amend, monitor P&L, TP/SL, margin/investment adjustment, AI-recommended parameters, and recommended zone backtest. Requires API credentials. Not for regular orders (okx-cex-trade), market data (okx-cex-market), or account info (okx-cex-portfolio).
Sections in SKILL.md
- Preflight
- Prerequisites
- Credential & Profile Check
- Step A — Verify credentials
- Step B — Confirm trading mode
- Handling 401 Errors
- Skill Routing
- Command Index
- Grid Bot
- DCA Bot (Spot & Contract)
- Smart Portfolio Bot
- Operation Flow
- Step 1 — Identify bot type and action
- Step 2 — Execute
- Step 3 — Verify after writes
- Key Rules
Key facts
- License
- MIT
- Installs on skills.sh
- 10,046 (Nov 2, 2026)
- Last repo commit
- Oct 28, 2026
- What it includes
- 5 files including SKILL.md: 4 reference files (no scripts)
- Skill version
- 1.5.0, per the SKILL.md frontmatter
What it includes
Spot, contract and coin-margined grid bots
Create, amend and stop a grid bot, close the leftover position of a stopped contract grid, and read positions, liquidation price, orders and sub-orders. Stopping a grid bot sells or closes its assets by default (stopType 1).
Try: “Create a spot grid bot for ETH between 2000 and 2800 USDT with 20 grids.”
Write ·
Grid botSpot DCA and Contract DCA Martingale bots
Create and stop a bot, read its orders, positions and sub-order cycles, and adjust margin or take-profit on a running contract DCA bot.
Write ·
DCA botAuto-rebalancing multi-asset portfolio bot
Create a 2 to 10 asset portfolio with target ratios, read its allocation, trigger or schedule a rebalance, and browse OKX-recommended zones and their backtests. SKILL.md says this module loads only with --modules bot.smartportfolio or bot.all.
Try: “Set up a Smart Portfolio bot across BTC, ETH and SOL with a 5% rebalance threshold.”
Write ·
Smart Portfolio bot
From the official docs
Permissions
High risk
A bot created with this skill runs on OKX's own servers and keeps trading real funds in live mode after you close the chat, and stopping one can sell its assets or close its positions. Test parameters in demo mode and check the bot directly in OKX as well as through Claude.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
A bot keeps trading after your session ends
SKILL.md says bots run server-side on OKX, so a grid, DCA or Smart Portfolio bot created in live mode keeps trading real funds without your chat session. SKILL.md asks the agent to confirm key parameters once before creating or changing a bot. Contract grid and contract DCA bots take a leverage setting. github.com
Stopping a bot can sell or close positions
grid-commands.md says stopType 1 (the default) sells all base assets back to quote for a spot grid and market-closes all open positions for a contract grid; stopType 2 keeps them. dca-commands.md and smart-portfolio-commands.md have the same sell-all or keep choice. SKILL.md says never to auto-transfer funds when a balance is short. github.com
It can add margin to a running bot
The add-margin and reduce-margin commands change how much of your account a contract DCA bot can use. github.com
Preflight upgrades the CLI and reads your credential setup
SKILL.md tells the agent to follow the shared preflight.md before any command. It runs `okx upgrade`, which installs newer @okx_ai/okx-trade-mcp and @okx_ai/okx-trade-cli packages from npm when it finds one (checked at most every 12 hours, writing ~/.okx/last_check), then `okx config show --json` and `okx auth status --json`, which list your API-key profiles and OAuth state. github.com
Credentials live outside the chat
SKILL.md tells the agent to never accept credentials in chat and to point you to okx config init instead. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | Use demo mode (--demo or a demo profile) to create and test bots with simulated funds instead of real money. |
|---|---|
| Talks to | OKX bot-management endpoints, through the okx CLI, using your API key or OAuth session |
| Sign-in and keys | The okx CLI stores an API key in ~/.okx/config.toml, or an OAuth session in its own auth-binary state, set up by okx config init or the okx-cex-auth skill. |
| Scopes |
|
Questions
What does the okx-cex-bot skill do?
It makes Claude create, amend, stop and monitor OKX grid bots, DCA Martingale bots and Smart Portfolio bots.
How do I install it?
Use the install box at the top of this page. Install the okx CLI first, then add the skill, then set up credentials with okx config init or the okx-cex-auth skill.
Do these bots keep running after I close the chat?
Yes. SKILL.md says all bots are native OKX server-side bots that run on OKX and do not need a local process, so they keep running once created.
Does it need an OKX account?
Yes. SKILL.md says this skill requires API credentials and a confirmed trading mode before creating, amending or stopping a bot.
Is it safe?
Creating a bot in live mode commits real funds to an automated strategy that keeps running on OKX after your session ends, and stopping a bot can sell its assets or market-close its positions (the stopType option). Use demo mode to test parameters first, and check the bot in OKX as well as through Claude. The shared preflight also runs okx upgrade and lists your credential profiles.
Can it use AI-recommended parameters?
SKILL.md lists AI-recommended parameters and recommended-zone backtests as part of the Smart Portfolio bot module. Treat them as a starting point, not a guarantee.
How is it different from okx-cex-trade?
This skill manages automated bots that OKX runs on its own servers. SKILL.md routes individual spot, swap, futures, option and event-contract orders to the sibling okx-cex-trade skill.
Information
updated Nov 2, 2026
- Repository
- okx/agent-skills
- Folder
skills/okx-cex-bot
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- okx-cex-bot SKILL.md · github.com
- okx/agent-skills README · github.com
- OKX CLI preflight · github.com
- okx-cex-bot grid-commands.md · github.com
- okx-cex-bot dca-commands.md · github.com
- okx-cex-bot smart-portfolio-commands.md · github.com