--- name: okx-dex-strategy description: "Limit-order strategy trading on OKX Agentic Wallet. Use this skill when the user wants to place a price-triggered limit order (buy a dip, take profit, stop loss, chase a high), cancel one or more pending orders, list active or historical orders, or resume orders that have been suspended by SA TEE upgrades. Distinct from okx-dex-swap (market orders, immediate execution at the best available aggregated price). Strategy orders are stored on the Agentic Wallet TEE and execute automatically when the user-defined trigger fires. Trigger phrases: limit order, place limit order, buy at price, sell when price reaches, take profit at, stop loss at, chase high, buy dip, cancel order, cancel all orders, my orders, list orders, active orders, suspended orders, resume orders, recover suspended orders, trader mode, agentic limit order." license: MIT metadata: author: okx version: "3.3.8" homepage: "https://web3.okx.com" --- # Onchain OS DEX Strategy (Phase 1) 4 P0 subcommands that wrap the Agentic Wallet limit-order surface — `create-limit`, `cancel`, `list`, `resume`. SA activation (Trader Mode upgrade / re-upgrade) is performed transparently by the CLI when the BE returns `UPGRADE_REQUIRED`; the skill does not need to expose that detail. ## Pre-flight Checks > Read `../okx-agentic-wallet/_shared/preflight.md`. If that file does not exist, fall back to `_shared/preflight.md`. Strategy endpoints require an authenticated Agentic Wallet session — confirm login before running any subcommand. ## Display labels & output language (single source of truth) This section is the **canonical rule** for user-facing strings. Every other section in this skill defers to it. **Canonical Display labels** — the only strings the agent may surface to the user. The CLI returns these directly (`statusLabel`) for `status`; for `strategyType` the agent looks them up from the §`strategyType` and §`status` tables below. | Surface | Canonical EN Display labels | |---|---| | `strategyType` (4 values) | `Buy Dip` / `Take Profit` / `Stop Loss` / `Buy Above` | | `status` (9 values) | `Expired` / `Cancelling` / `Cancelled` / `Failed` / `Trading` / `Completed` / `Creating` / `Active` / `Suspended` | **Translation rule** — match the user's conversation language. Display labels above are canonical English. When the user converses in another language, the agent translates the label at output time to match the conversation language. **Never** (these rules apply everywhere in this skill): - mix two languages in one label (pick one — never render the English label and a translation side by side), - expose the underlying **enum name** (`BUY_DIP`, `CHASE_HIGH`, `COMPLETED`, …) to the user, - expose the underlying **CLI flag value** (`buy_dip`, `chase_high`, `completed`, `cancelled`, …) to the user, - pass through the CLI's raw `statusLabel` verbatim when the user is conversing in a non-English language — translate it. **Notes:** - CHASE_HIGH renders as **`Buy Above`** in English (not "Chase High"). - SPEEDING_UP (-4) was removed 2026-05-08 — not a valid filter or display value. ## Boundary vs `okx-dex-swap` | User intent | Skill | |---|---| | "Swap X for Y now" / "Buy 0.5 ETH with USDC" | `okx-dex-swap` (market order, immediate execution) | | "Buy ETH if it dips to $2000" / "Sell when ETH hits $5000" / "Take profit at X" / "Stop loss at Y" | this skill (price-triggered limit order) | | "Cancel my pending order" | this skill | | "What limit orders do I have?" | this skill | If the venue is named explicitly (Uniswap, PancakeSwap, Raydium, Curve, ...) → re-route to `okx-dapp-discovery`. This skill is for OKX-aggregated limit orders only. ## Command Index ### 1. `onchainos strategy create-limit` Place a single price-triggered limit order. ``` onchainos strategy create-limit \ --chain-id \ --from-token
\ --to-token
\ --amount \ --direction \ --trigger-price \ [--current-price ] \ [--slippage ] \ [--mev-protection ] \ [--expires-in ] ``` | Flag | Required | Notes | |---|---|---| | `--chain-id` | Y | Chain id or alias: `1`, `solana`, `bsc`, `arbitrum`, `base`, `xlayer` | | `--from-token` | Y | Sell-side token contract address | | `--to-token` | Y | Buy-side token contract address | | `--amount` | Y | Amount of `from_token` to sell (string, no precision loss) | | `--direction` | Y | `buy` or `sell` (case-insensitive). Strategy type is derived from `--direction` + `--trigger-price` + the current market price; the agent does **not** pass a strategy type explicitly. | | `--trigger-price` | Y | USD trigger price. Required for strategy type derivation. | | `--current-price` | N | Current USD price of the comparison token (to-token for `buy`, from-token for `sell`). When omitted the CLI fetches it via `market price`. Pass it to skip the extra HTTP round-trip when the agent already retrieved the price for the confirmation page. | | `--slippage` | N | Slippage tolerance in percent. Default `15` (= 15%). Pass the percent as a plain number — the CLI converts to BE wire format (divides by 100, e.g. `20` → `"0.2"`). When the user says "slippage 20" / "slippage 20%" / "use 20% slippage" — all map to `--slippage 20`. | | `--mev-protection` | N | Tri-state value: `on` / `off` / `default` (default = `default`). `on` → `routerModeType=2` (MEV protection ON), `off` → `routerModeType=3` (OFF), `default` → `routerModeType=1` (CLI does not opt in or out; BE picks). | | `--expires-in` | N | Order TTL in seconds. Default 604800 (7 days) — see §Default order expiry. | **Output (JSON, always — the CLI has no human-format mode):** ```json { "ok": true, "data": { "orderId": "", "status": , "statusLabel": "