$npx -y skills add gate/gate-skills --skill gate-exchange-flashswap-assistantL2 flash swap orchestration: fc preview and create (1:1, 1:N, N:1), spot balance checks, min/max gates, optional dust-to-GT, order history. Use this skill whenever the user wants flash swap, instant convert, consolidate alts to one coin, split one asset into several via flash, di
| 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-flashswap-assistant |
| 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 flash-swap order` |
| 23 | - `gate-cli cex flash-swap pairs` |
| 24 | - `gate-cli cex flash-swap orders` |
| 25 | - `gate-cli cex flash-swap preview-many-to-one` |
| 26 | - `gate-cli cex flash-swap preview-one-to-many` |
| 27 | - `gate-cli cex flash-swap preview-v1` |
| 28 | - `gate-cli cex spot account get` |
| 29 | - `gate-cli cex wallet balance small` |
| 30 | - `gate-cli cex wallet balance small-history` |
| 31 | |
| 32 | **Execution Operations (Write)** |
| 33 | |
| 34 | - `gate-cli cex flash-swap create-many-to-one` |
| 35 | - `gate-cli cex flash-swap create-one-to-many` |
| 36 | - `gate-cli cex flash-swap create-v1` |
| 37 | - `gate-cli cex wallet balance convert-small` |
| 38 | |
| 39 | ### Authentication |
| 40 | |
| 41 | - **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)). |
| 42 | - **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. |
| 43 | - API Key Required: Yes (authenticated Gate Exchange MCP) |
| 44 | - **Permissions:** Flash convert write (`gate-cli cex flash-swap preview` / `create` or `preview-v1` / `create-v1` / multi-currency variants; MCP `cex_fc_*` when using Exchange MCP), spot account read, wallet small-balance read and convert as required by the gateway (configure keys with least privilege) |
| 45 | - **Portal:** create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage |
| 46 | |
| 47 | ### Installation Check |
| 48 | |
| 49 | - **Required:** Gate (main); **`gate-cli`** when using CLI-backed flows (install via [`setup.sh`](./setup.sh) from this skill when applicable). |
| 50 | - **Install (MCP / IDE):** Cursor: `gate-mcp-cursor-installer`; Codex: `gate-mcp-codex-installer`; Claude: `gate-mcp-claude-installer`; OpenClaw: `gate- |