$npx -y skills add gate/gate-skills --skill gate-exchange-futuresGate Exchange USDT perpetual futures trading skill. Use when the user wants to trade contracts, open/close perpetual positions, or manage futures leverage. Triggers on 'open long', 'close short', 'USDT perpetual', 'futures TP/SL'.
| 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 Futures Trading Suite |
| 7 | |
| 8 | ## General Rules |
| 9 | |
| 10 | ⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding. |
| 11 | Do NOT select or call any tool until all rules are read. These rules have the highest priority. |
| 12 | → Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md) |
| 13 | - **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. |
| 14 | |
| 15 | ## Skill Dependencies |
| 16 | |
| 17 | |
| 18 | ### gate-cli commands used |
| 19 | |
| 20 | **Query Operations (Read-only)** |
| 21 | |
| 22 | - `gate-cli cex futures account get` |
| 23 | - `gate-cli cex futures market contract` |
| 24 | - `gate-cli cex futures position get-dual` |
| 25 | - `gate-cli cex futures order get` |
| 26 | - `gate-cli cex futures market orderbook` |
| 27 | - `gate-cli cex futures position get` |
| 28 | - `gate-cli cex futures price-trigger get` |
| 29 | - `gate-cli cex futures market tickers` |
| 30 | - `gate-cli cex futures order list` |
| 31 | - `gate-cli cex futures position list` |
| 32 | - `gate-cli cex futures price-trigger list` |
| 33 | |
| 34 | **Execution Operations (Write)** |
| 35 | |
| 36 | - `gate-cli cex futures order amend` |
| 37 | - `gate-cli cex futures order cancel` |
| 38 | - `gate-cli cex futures order cancel` |
| 39 | - `gate-cli cex futures price-trigger cancel` |
| 40 | - `gate-cli cex futures price-trigger cancel-all` |
| 41 | - `gate-cli cex futures order add; gate-cli cex futures order close; gate-cli cex futures order long; gate-cli cex futures order remove; gate-cli cex futures order short` |
| 42 | - `gate-cli cex futures price-trigger create` |
| 43 | - `gate-cli cex futures position update-dual-cross-mode` |
| 44 | - `gate-cli cex futures position update-dual-leverage` |
| 45 | - `gate-cli cex futures position update-cross-mode` |
| 46 | - `gate-cli cex futures position update-leverage` |
| 47 | - `gate-cli cex futures price-trigger update` |
| 48 | |
| 49 | ### Authentication |
| 50 | - **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, profiles, and defaults (see [gate-cli](https://github.com/gate/gate-cli)). |
| 51 | - **Env / flags:** **`gate-cli config init`** is **not** required when credentials are already supplied — e.g. **both** **`GATE_API_KEY`** and **`GATE_API_SECRET`** set on the host, or **`--api-key`** / **`--api-secret`** where supported — never ask the user to paste secrets into chat. |
| 52 | - **Permissions:** Fx:Write |
| 53 | - **Portal:** create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage |
| 54 | |
| 55 | ### Installation Check |
| 56 | - **Required:** `gate-cli` (run `sh ./setup.sh` from this skill directory if missing; optional `GATE_CLI_SETUP_MODE=release`). |
| 57 | - Add `$HOME/.openclaw/skills/bin` to **`PATH`** if you invoke `gate-cli` by name (or the directory where [`setup.sh`](./setup.sh) installs it). |
| 58 | - **Credentials:** When **` |