Agent skill · marketing growth · okx

okx-cex-trade

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).

Why this skill is useful

Adds executable commands for managing trades on the OKX exchange, including options and event contracts, which are not commonly known.

What it needs

Requires npm, okx installed locally. Requires okx account access. About 13k tokens when loaded. Last updated 2026-07-22. 160 stars on the source repository.

What this skill does

OKX CEX Trading CLI 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 (swapplacealgoorder) 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. Preflight Before running any command, follow ../shared/preflight.md. Use metadata.version from this file's frontmatter as the reference for Step 2. Prerequisites 1. Install okx CLI: 2. Configure credentials: 3. Test with demo mode (simulated trading, no real funds): Security: NEVER accept credentials in chat. Guide users to okx config init for setup. Credential & Profile Check Run this check before any authenticated command. The auth method is detected during preflight Step 2 and remembered for the session. Step A — Verify credentials 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. Apply in this order — first match wins: config show --json has any profile with a non-empty apikey field → API Key mode. Proceed to Step B. No API-key profile AND auth status --json returns "status":"loggedin" → OAuth mode. Proceed to Step B. No API-key profile AND "status":"pending" — login is in progress, wait for it to complete. No API-key profile AND "status":"notloggedin" — stop all operations, load okx-cex-auth skill and follow login steps, wait for completion. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills okx/okx-cex-trade

View the source on GitHub

Browse the @skills marketplace