earn-hunter
Automatically monitors OKX Flash Earn, Fixed Earn and Flexible Earn opportunities, sends push…
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',
$ npx -y skills add okx/agent-skills --skill okx-cex-trade --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/okx-cex-tradeContext preview
The summary Claude sees to decide when to auto-load this skill.
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',
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.4.8"
homepage: "https://www.okx.com"
agent:
requires:
bins: ["okx"]
install:
- id: npm
kind: node
package: "@okx_ai/okx-trade-cli@1.4.8"
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…
Use this skill when the user wants to 'login/log in/sign in', 'authenticate', 'authorize',…
Manage Grid bots (spot/contract/coin-margined) and DCA Martingale bots (Spot DCA 现货马丁 /…
Manages OKX Simple Earn (flexible savings/lending), Flash Earn, On-chain Earn (staking/DeFi),…
Use this skill when the user asks for: price of any asset, ticker, order book, candles,…
This skill should be used when the user asks about 'account balance', 'how much USDT do I…