$npx -y skills add gate/gate-skills --skill gate-exchange-tradingGate Trading L2. Use when the user wants to execute complex trades, margin borrowing, or query positions and open orders. Triggers on 'market buy', 'margin borrow', 'TradFi', 'Alpha', or spot-plus-futures combos. Requires Action Draft.
| 1 | ### Resolving `gate-cli` (binary path) |
| 2 | |
| 3 | Resolve **`gate-cli`** in order: **(1)** **`command -v gate-cli`** and **`gate-cli --version`** succeeds; **(2)** **`${HOME}/.local/bin/gate-cli`** if executable; **(3)** **`${HOME}/.openclaw/skills/bin/gate-cli`** if executable. Canonical rules: [`exchange-runtime-rules.md`](https://github.com/gate/gate-skills/blob/master/skills/exchange-runtime-rules.md) §4 (or [`gate-runtime-rules.md`](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md) §4). |
| 4 | |
| 5 | |
| 6 | # Gate Exchange Trading |
| 7 | |
| 8 | This is an **L2 composite skill** for users who want a single skill to complete the full trading loop: |
| 9 | |
| 10 | `judge the opportunity -> control risk -> produce order draft -> explicit confirmation -> execute -> verify/manage` |
| 11 | |
| 12 | It is neither a pure research skill nor a pure execution skill. Its purpose is to provide a complete trading workflow inside one skill. |
| 13 | |
| 14 | ## General Rules |
| 15 | |
| 16 | ⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding. |
| 17 | Do NOT select or call any tool until all rules are read. These rules have the highest priority. |
| 18 | → Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md) |
| 19 | - **Only use the `gate-cli` commands explicitly listed in this skill.** Commands not documented here must NOT be run for these workflows, even if other interfaces expose them. |
| 20 | |
| 21 | Before calling any named MCP tool, verify that the concrete tool name exists in the current runtime tool list. If a helper tool is absent, disclose the mismatch, use only the nearest valid fallback combination, and do not overclaim unavailable coverage such as rankings, macro breadth, or automated fund-flow tracing. |
| 22 | |
| 23 | Also validate that the returned payload is rich enough for the intended analytical claim. If a tool returns sparse metadata, empty structures, or requires missing disambiguation inputs, treat it as supporting context only rather than primary evidence. |
| 24 | |
| 25 | For portability across hosts, treat the documented `gate-cli cex …` commands as the baseline: |
| 26 | |
| 27 | - `info_*` -> Gate Info MCP |
| 28 | - `news_feed_*` -> Gate News MCP |
| 29 | - read-only spot/futures market data -> `gate-cli cex spot market …` / `gate-cli cex futures market …` (public endpoints where applicable) |
| 30 | - private order / account / position flows -> authenticated `gate-cli` (**`GATE_API_KEY`** / **`GATE_API_SECRET`** and/or **`gate-cli config init`**; when **both** env vars are set on the host, **`config init`** is not required) |
| 31 | |
| 32 | Do not make `news_events_*` a required dependency in scenario design, because it is not part of the documented baseline news surface. |
| 33 | |
| 34 | ## Execution mode |
| 35 | |
| 36 | **Read and strictly follow** [`references/gate-cli.md`](./references/gate-cli.md), then execute this skill's trading workflow. |
| 37 | |
| 38 | - `SKILL.md` keeps composite routing, trade lifecycle policy, and guardrails. |
| 39 | - `references/gate-cli.md` is the authoritative `gate-cli` orchestration contract for cross-domain tool sequencing, execution gates, and degradation. |
| 40 | |
| 41 | --- |
| 42 | |
| 43 | Read `references/scenarios.md` for: |
| 44 | |
| 45 | - representative user scenarios |
| 46 | - representative prompt examples |
| 47 | - expected tool-routing patterns |
| 48 | |
| 49 | ## Authentication |
| 50 | |
| 51 | - **Interactive file setup:** when **`GATE_API_KEY`** and **`GATE_API_SECRET`** are **not** both set on the host, run **`gate-cli config init`** to complete the wizard for API key, secret, profi |