okx-cex-bot

Create, amend, stop, and monitor OKX grid and DCA Martingale trading bots via CLI.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-bot-nickthelegend
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okx-cex-bot
Source: https://github.com/nickthelegend/xorr-monorepo/tree/main/.agents/skills/okx-cex-bot
Command: npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-bot-nickthelegend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @okx_ai/okx-trade-cli.

What problem does it solve? Managing OKX grid and DCA (Martingale) bots normally requires navigating the exchange UI or writing raw API calls; this Skill lets an AI agent create, amend, stop, and monitor those server-side bots through the okx CLI with correct parameters, credential checks, and safety rules. ## Core Features & Use Cases - Grid Bot Management: Create spot, USDT-margined, and coin-margined contract grid bots with price ranges, grid counts, leverage, TP/SL, and amend or stop them later. - DCA Martingale Bots: Launch spot and contract DCA bots with safety orders, price-step multipliers, volume multipliers, take-profit/stop-loss ratios, and price or RSI triggers. - Monitoring & Risk Checks: Query bot PnL, positions, liquidation price estimates, and sub-order fills, with built-in rules against auto-transferring funds or fabricating algo IDs. - Use Case: A user says "Start a BTC grid bot between $90k and $100k with 10 grids and 1000 USDT" — the agent checks price and balance, creates the bot, and confirms it is active. ## Quick Start Ask the agent to create a BTC spot grid bot between two prices with a set number of grids and a USDT investment amount, and it will verify your credentials, confirm parameters, and launch the bot.

Frequently Asked Questions about okx-cex-bot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a grid bot on OKX?▼

Run okx bot grid create with the instrument, algoOrdType (grid for spot or contract_grid for futures), price range, grid count, and investment amount. Contract grids also require direction and leverage, and the bot runs server-side on OKX once created.

How to set up a DCA Martingale bot on OKX?▼

Use okx bot dca create with algoOrdType spot_dca or contract_dca, an initial order amount, max safety orders, and a take-profit ratio. When maxSafetyOrds is above zero you must also provide safety order amount, price steps, and step and volume multipliers.

Does the OKX bot CLI support demo trading?▼

Yes, demo mode is supported for all bot commands. OAuth users add the --demo flag, while API-key users select a demo profile with --profile, letting you test grid and DCA bots without risking real funds.

Why does stopping an OKX grid bot return an error?▼

The bot is likely already stopped, so check bot grid orders --history first to confirm its state. Also verify the algoOrdType matches the bot's actual type from the orders output, since a mismatch triggers error 50016.

What happens if my balance is insufficient when creating a bot?▼

The agent reports the shortfall between available and required funds and asks how to proceed. It never auto-transfers funds; you choose to transfer manually, reduce the investment size, or cancel the operation.

Can spot DCA bots on OKX go short?▼

No, spot DCA bots only support the long direction. If you need short exposure with a Martingale strategy, use a contract DCA bot on a perpetual swap instrument with the direction set to short.