earn-hunter
Automatically monitors OKX Flash Earn, Fixed Earn and Flexible Earn opportunities, sends push notifications, and guides…
Use when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC perp', 'short ETH swap', 'open a position', 'close a position', 'set take profit', 'limit take profit', 'immediate TP', 'set stop loss',
Claude Code
$ npx -y skills add okx/agent-skills --skill okx-cex-trade --agent claude-code
Codex
$ npx skills add okx/agent-skills --skill okx-cex-trade -a codex -y
Cursor
$ npx skills add okx/agent-skills --skill okx-cex-trade -a cursor -y
Gemini CLI
$ npx skills add okx/agent-skills --skill okx-cex-trade -a gemini-cli -y
GitHub Copilot
$ npx skills add okx/agent-skills --skill okx-cex-trade -a github-copilot -y
OpenCode
$ npx skills add okx/agent-skills --skill okx-cex-trade -a opencode -y
Windsurf
$ npx skills add okx/agent-skills --skill okx-cex-trade -a windsurf -y
name: okx-cex-trade
description: "Use when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC perp', 'short ETH swap', 'open a position', 'close a position', 'set take profit', 'limit take profit', 'immediate TP', 'set stop loss', 'self-trade prevention', 'stpMode', 'auto-cancel on close', 'trailing stop', 'pending order', 'chase order', 'iceberg', 'TWAP', 'split order', 'large order', 'set leverage', 'check my orders', 'fill history', 'buy a call', 'sell a put', 'option chain', 'implied volatility', 'IV', 'Greeks', 'delta', 'gamma', 'event contract', 'buy Yes', 'buy No', 'buy Up', 'buy Down', 'prediction market', or any request to place, cancel, or amend spot, swap, futures, options, or event contract orders on OKX CEX. Covers conditional (TP/SL/trailing) algo orders. Requires API credentials. Do NOT use for market data (okx-cex-market), account balance (okx-cex-portfolio), or bots (okx-cex-bot)."
license: MIT
metadata:
author: okx
version: "1.5.2"
homepage: "https://www.okx.com"
agent:
requires:
bins: ["okx"]
install:
- id: npm
kind: node
package: "@okx_ai/okx-trade-cli@1.5.2"
bins: ["okx"]
label: "Install okx CLI (npm)"Spot, perpetual swap, delivery futures, **options**, and **event contract** order management on OKX exchange. Place, cancel, amend, and monitor orders; query option chains and Greeks; trade binary outcome event contracts (Yes/No, Up/Down); set take-profit/stop-loss and trailing stops; manage leverage and positions. **Requires API credentials.**
> **CLI vs MCP tool names** — Subcommands use spaces (`okx swap algo place`, `okx bot grid create`), not hyphens. Do NOT convert an MCP tool identifier (`swap_place_algo_order`) into a hyphen-joined CLI command (`okx swap place-algo`) — that will be rejected with "Unknown command". Per-module mapping tables live in `references/<module>-commands.md`.
Before running any command, follow [`../_shared/preflight.md`](../_shared/preflight.md). Use `metadata.version` from this file's frontmatter as the reference for Step 2.
1. Install `okx` CLI:
npm install -g @okx_ai/okx-trade-cli
2. Configure credentials:
okx config init # select site -> follow browser OAuth flow
3. Test with demo mode (simulated trading, no real funds):
okx --demo spot orders
> **Security**: NEVER accept credentials in chat. Guide users to `okx config init` for setup.
**Run this check before any authenticated command.** The auth method is detected during [preflight](../_shared/preflight.md) 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:
**Resolution rules:** 1. Current message intent is clear (e.g. "real" / "实盘" / "live" → live; "test" / "模拟" / "demo" → demo) → use it and inform the user 2. Current message has no explicit declaration → check conversation context for a previous choice:
**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` |
**Authentication error** (error contains "401", "Session expired", or "Run `okx auth login` first"): 1. **Stop immediately** — do not retry the same command 2. Inform the user: "Authentication failed. Your session may have expired." 3. Load `okx-cex-auth` skill and follow the re-authentication steps 4. After successful re-authentication, retry the original command
| Mode | Funds | API Key param | OAuth param | |---|---|---|---| | 实盘 (live) | Real money — irreversible | `--profile <live-profile>` | *(default, no flag)* | | 模拟盘 (demo) | Simulated — no real funds | `--profile <demo-profile>` | `--demo` |
**Rules:** 1. Trading mode is **required** on every authenticated command — determined in "Credential & Profile Check" Step B 2. Every response after a command must append: `[mode: live]` or `[mode: demo]`
A collection of AI agent skills for OKX exchange operations. Each skill is a self-contained Markdown file with YAML frontmatter that tells an AI agent when to activate and how to execute tasks via the okx CLI.
Automatically monitors OKX Flash Earn, Fixed Earn and Flexible Earn opportunities, sends push notifications, and guides…
Use this skill when the user wants to 'login/log in/sign in', 'authenticate', 'authorize', 'connect OKX account', 'set up…
Manage Grid bots (spot/contract/coin-margined), DCA Martingale bots (Spot DCA 现货马丁 / Contract DCA 合约马丁), Smart Portfolio bots…
Manages OKX Simple Earn (flexible savings/lending), Flash Earn, On-chain Earn (staking/DeFi), Dual Investment (DCD/双币赢), and…
Use this skill when the user asks for: price of any asset, ticker, order book, candles, OHLCV, funding rate, open interest, OI…
This skill should be used when the user asks about 'account balance', 'how much USDT do I have', 'my funding account', 'show my…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…