Claude
Skills
Sign in
Back

gate-exchange-bot

Included with Lifetime
$97 forever

Gate Exchange AI bot skill. Use this skill whenever the user wants AIHub strategy recommendation, manual spot/margin/infinite/futures grid creation, manual spot/contract martingale creation, or running strategy portfolio query and stop flows. Trigger phrases include recommend strategy, spot grid, futures grid, martingale, running bots, bot detail, and stop bot.

General

What this skill does


# Gate Exchange Bot

## General Rules

⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.
Do NOT select or call any tool until all rules are read. These rules have the highest priority.
→ Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)
- **Only call MCP tools explicitly listed in this skill.** Tools not documented here must NOT be called, even if they
  exist in the MCP server.
- **Only use the `gate-cli` subcommands explicitly listed in this skill and its references.** Commands not documented here must NOT be run for these workflows, even if other interfaces expose them.

## Authoring Language

This skill is authored in English. End-user replies should still follow normal language adaptation.

## Skill Dependencies

### gate-cli commands used

**Query Operations (Read-only)**

- `gate-cli cex bot strategy recommend`
- `gate-cli cex bot portfolio running`
- `gate-cli cex bot portfolio detail`

**Execution Operations (Write)**

- `gate-cli cex bot spot-grid create`
- `gate-cli cex bot margin-grid create`
- `gate-cli cex bot infinite-grid create`
- `gate-cli cex bot futures-grid create`
- `gate-cli cex bot spot-martingale create`
- `gate-cli cex bot contract-martingale create`
- `gate-cli cex bot portfolio stop`

### MCP-backed command mapping

| `gate-cli` command | Backing bot capability |
|---|---|
| `gate-cli cex bot strategy recommend` | `cex_bot_get_ai_hub_strategy_recommend` |
| `gate-cli cex bot portfolio running` | `cex_bot_get_ai_hub_portfolio_running` |
| `gate-cli cex bot portfolio detail` | `cex_bot_get_ai_hub_portfolio_detail` |
| `gate-cli cex bot spot-grid create` | `cex_bot_post_ai_hub_spot_grid_create` |
| `gate-cli cex bot margin-grid create` | `cex_bot_post_ai_hub_margin_grid_create` |
| `gate-cli cex bot infinite-grid create` | `cex_bot_post_ai_hub_infinite_grid_create` |
| `gate-cli cex bot futures-grid create` | `cex_bot_post_ai_hub_futures_grid_create` |
| `gate-cli cex bot spot-martingale create` | `cex_bot_post_ai_hub_spot_martingale_create` |
| `gate-cli cex bot contract-martingale create` | `cex_bot_post_ai_hub_contract_martingale_create` |
| `gate-cli cex bot portfolio stop` | `cex_bot_post_ai_hub_portfolio_stop` |

### Authentication

- **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)).
- **Env / flags:** **`gate-cli config init`** is not required when credentials are already supplied — for example when **both** **`GATE_API_KEY`** and **`GATE_API_SECRET`** are set on the host, or when **`--api-key`** / **`--api-secret`** are supported. Never ask the user to paste secrets into chat.
- API Key Required: Yes
- **Permissions:** Bot:Read, Bot:Write
- **Portal:** create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage

### Installation Check

- **Required:** `gate-cli`. Run `sh setup.sh` from this skill directory if it is missing. Optional: `GATE_CLI_SETUP_MODE=release`.
- Add `$HOME/.openclaw/skills/bin` to **`PATH`** if you invoke `gate-cli` by name.
- **Host dependencies for `setup.sh`:** `curl`, `tar`, and either `shasum` or `sha256sum`. If user-local installation fails, `setup.sh` may fall back to `sudo install` into `/usr/local/bin`.
- **Credentials:** When **`GATE_API_KEY`** and **`GATE_API_SECRET`** are both set (non-empty) for the host, do not require `gate-cli config init`. When both are unset or empty, remind the operator to run `gate-cli config init` or configure matching environment variables outside chat.
- **Sanity check:** Before any mutating call, confirm the CLI behaves as expected with a read-only probe such as `gate-cli --version` or `gate-cli cex bot strategy recommend --help`.

### Resolving `gate-cli` (binary path)

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

## Execution

Read and strictly follow `references/gate-cli.md`, then execute the matched route in this `SKILL.md`.

- `SKILL.md` keeps intent routing, safety policy, and product boundaries.
- `references/gate-cli.md` is the authoritative execution contract for command probing, `body` payload handling, confirmation gates, and verification.
- `references/scenarios.md` provides scenario-style examples for review, testing, and publication completeness.

## Domain Knowledge

- Strategy recommendation is read-only and must stay separate from creation.
- Grid and martingale flows require different payload schemas and must not share fields across products.
- Running-strategy stop is always a single-strategy action; bulk stop is out of scope.
- Percentage-style business inputs must be normalized into decimal ratio strings before any write command.
- Portfolio detail and stop flows depend on an exact `strategy_id` plus the correct `strategy_type`.

## Module Overview

| Module | Description | Trigger keywords |
|--------|-------------|------------------|
| **Discover** | Recommend AIHub bot strategies by market, strategy type, filter, or refresh context | `recommend strategy`, `bundle`, `top1`, `refresh recommendation`, `filter strategy` |
| **Spot Grid** | Manual spot grid creation | `spot grid`, `manual grid` |
| **Margin Grid** | Manual margin grid creation | `margin grid` |
| **Infinite Grid** | Manual infinite grid creation | `infinite grid` |
| **Futures Grid** | Manual futures grid creation | `futures grid`, `contract grid` |
| **Spot Martingale** | Manual spot martingale creation | `spot martingale` |
| **Contract Martingale** | Manual contract martingale creation | `contract martingale`, `futures martingale` |
| **Portfolio List** | List running strategies | `running strategies`, `bots I have running`, `portfolio running` |
| **Portfolio Detail** | Query a single strategy detail | `strategy detail`, `bot detail`, `P&L detail` |
| **Portfolio Stop** | Stop one running strategy | `stop strategy`, `stop bot` |

## Routing Rules

| Intent | Example phrases | Route to |
|--------|-----------------|----------|
| **Strategy recommendation** | "Recommend a BTC strategy", "Give me a spot grid recommendation", "Refresh that recommendation" | Read `references/strategy-recommend.md` |
| **Spot grid create** | "Create a BTC spot grid from 60000 to 72000 with 50 grids and 1000 USDT" | Read `references/create-spot-grid.md` |
| **Margin grid create** | "Create a margin grid with 3x leverage and 50 grids" | Read `references/create-margin-grid.md` |
| **Infinite grid create** | "Create a BTC infinite grid with 1.5% profit per grid" | Read `references/create-infinite-grid.md` |
| **Futures grid create** | "Create a BTC futures grid with 5x leverage and neutral direction" | Read `references/create-futures-grid.md` |
| **Spot martingale create** | "Create a spot martingale that adds after a 2% drop" | Read `references/create-spot-martingale.md` |
| **Contract martingale create** | "Create a contract martingale, 5x leverage, short bias" | Read `references/create-contract-martingale.md` |
| **Running list** | "What bots do I have running?" | Read `references/list-running.md` |
| **Strategy detail** | "Show me that bot's detailed P&L" | Read `references/get-detail.md` |
| **Stop strategy** | "Stop that BTC grid bot" | Read `references/stop-strategy.md` |

## gate-cli Command Index

| # | Command | Purpose |
|---|---------|---------|
| 1 | `gate-cli cex bot strategy recommend` | Discover recommendations for `to
Files: 16
Size: 62.2 KB
Complexity: 67/100
Category: General

Related in General