gate-exchange-bot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate Exchange Bot
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
- 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 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.
gate-cli
⚠️ 停止操作——在继续之前,您必须阅读并严格遵守共享的运行时规则。
在未阅读所有规则之前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读 gate-runtime-rules.md
- 仅调用本技能中明确列出的MCP工具。 即使MCP服务器中存在未在此处记录的工具,也不得调用。
- 仅使用本技能及其参考文档中明确列出的子命令。 即使其他接口提供了未在此处记录的命令,也不得在这些工作流中运行。
gate-cli
Authoring Language
编写语言
This skill is authored in English. End-user replies should still follow normal language adaptation.
本技能以英文编写。最终用户回复仍需遵循常规语言适配规则。
Skill Dependencies
技能依赖
gate-cli commands used
使用的gate-cli命令
Query Operations (Read-only)
gate-cli cex bot strategy recommendgate-cli cex bot portfolio runninggate-cli cex bot portfolio detail
Execution Operations (Write)
gate-cli cex bot spot-grid creategate-cli cex bot margin-grid creategate-cli cex bot infinite-grid creategate-cli cex bot futures-grid creategate-cli cex bot spot-martingale creategate-cli cex bot contract-martingale creategate-cli cex bot portfolio stop
查询操作(只读)
gate-cli cex bot strategy recommendgate-cli cex bot portfolio runninggate-cli cex bot portfolio detail
执行操作(写入)
gate-cli cex bot spot-grid creategate-cli cex bot margin-grid creategate-cli cex bot infinite-grid creategate-cli cex bot futures-grid creategate-cli cex bot spot-martingale creategate-cli cex bot contract-martingale creategate-cli cex bot portfolio stop
MCP-backed command mapping
基于MCP的命令映射
| Backing bot capability |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 对应的机器人能力 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Authentication
身份验证
- Interactive file setup: when and
GATE_API_KEYare not both set on the host, runGATE_API_SECRETto complete the wizard for API key, secret, profiles, and defaults (see gate-cli).gate-cli config init - Env / flags: is not required when credentials are already supplied — for example when both
gate-cli config initandGATE_API_KEYare set on the host, or whenGATE_API_SECRET/--api-keyare supported. Never ask the user to paste secrets into chat.--api-secret - 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
- 交互式文件设置: 当主机上未同时设置和
GATE_API_KEY时,运行GATE_API_SECRET完成API密钥、密钥、配置文件和默认设置的向导(参见gate-cli)。gate-cli config init - 环境变量/标志: 当已提供凭据时,无需运行——例如主机上已同时设置
gate-cli config init和GATE_API_KEY,或支持GATE_API_SECRET/--api-key参数时。切勿要求用户在聊天中粘贴密钥。--api-secret - 需要API密钥:是
- 权限: Bot:Read, Bot:Write
- 门户: 在聊天外创建或轮换密钥:https://www.gate.com/myaccount/profile/api-key/manage
Installation Check
安装检查
- Required: . Run
gate-clifrom this skill directory if it is missing. Optional:sh setup.sh.GATE_CLI_SETUP_MODE=release - Add to
$HOME/.openclaw/skills/binif you invokePATHby name.gate-cli - Host dependencies for :
setup.sh,curl, and eithertarorshasum. If user-local installation fails,sha256summay fall back tosetup.shintosudo install./usr/local/bin - Credentials: When and
GATE_API_KEYare both set (non-empty) for the host, do not requireGATE_API_SECRET. When both are unset or empty, remind the operator to rungate-cli config initor configure matching environment variables outside chat.gate-cli config init - Sanity check: Before any mutating call, confirm the CLI behaves as expected with a read-only probe such as or
gate-cli --version.gate-cli cex bot strategy recommend --help
- 必需: 。如果缺失,请从本技能目录运行
gate-cli。可选:sh setup.sh。GATE_CLI_SETUP_MODE=release - 如果直接通过名称调用,请将
gate-cli添加到**$HOME/.openclaw/skills/bin**中。PATH - 的主机依赖:
setup.sh、curl以及tar或shasum。如果用户本地安装失败,sha256sum可能会回退到使用setup.sh安装到sudo install。/usr/local/bin - 凭据: 当主机上和
GATE_API_KEY均已设置(非空)时,无需要求运行GATE_API_SECRET。当两者均未设置或为空时,提醒操作员运行gate-cli config init或在聊天外配置匹配的环境变量。gate-cli config init - 完整性检查: 在执行任何变更操作之前,通过只读探测确认CLI运行正常,例如或
gate-cli --version。gate-cli cex bot strategy recommend --help
Resolving gate-cli
(binary path)
gate-cli解析gate-cli
(二进制路径)
gate-cliResolve in order: (1) and succeeds; (2) if executable; (3) if executable. Canonical rules: §4 (or §4).
gate-clicommand -v gate-cligate-cli --version${HOME}/.local/bin/gate-cli${HOME}/.openclaw/skills/bin/gate-cliexchange-runtime-rules.mdgate-runtime-rules.md按以下顺序解析**:(1)** 且执行成功;(2) 如果可执行;(3) 如果可执行。标准规则: §4(或 §4)。
gate-clicommand -v gate-cligate-cli --version${HOME}/.local/bin/gate-cli${HOME}/.openclaw/skills/bin/gate-cliexchange-runtime-rules.mdgate-runtime-rules.mdExecution
执行流程
Read and strictly follow , then execute the matched route in this .
references/gate-cli.mdSKILL.md- keeps intent routing, safety policy, and product boundaries.
SKILL.md - is the authoritative execution contract for command probing,
references/gate-cli.mdpayload handling, confirmation gates, and verification.body - provides scenario-style examples for review, testing, and publication completeness.
references/scenarios.md
阅读并严格遵循,然后执行本中匹配的流程。
references/gate-cli.mdSKILL.md- 用于意图路由、安全策略和产品边界定义。
SKILL.md - 是命令探测、
references/gate-cli.md负载处理、确认机制和验证的权威执行契约。body - 提供场景式示例,供评审、测试和确保发布完整性。
references/scenarios.md
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 plus the correct
strategy_id.strategy_type
- 策略推荐是只读操作,必须与创建操作分开。
- 网格和马丁格尔流程需要不同的负载模式,产品之间不得共享字段。
- 运行中策略的停止始终是单策略操作;批量停止不在范围内。
- 在执行任何写入命令之前,必须将百分比形式的业务输入标准化为小数比率字符串。
- 组合详情和停止流程依赖于精确的和正确的
strategy_id。strategy_type
Module Overview
模块概述
| Module | Description | Trigger keywords |
|---|---|---|
| Discover | Recommend AIHub bot strategies by market, strategy type, filter, or refresh context | |
| Spot Grid | Manual spot grid creation | |
| Margin Grid | Manual margin grid creation | |
| Infinite Grid | Manual infinite grid creation | |
| Futures Grid | Manual futures grid creation | |
| Spot Martingale | Manual spot martingale creation | |
| Contract Martingale | Manual contract martingale creation | |
| Portfolio List | List running strategies | |
| Portfolio Detail | Query a single strategy detail | |
| Portfolio Stop | Stop one running strategy | |
| 模块 | 描述 | 触发关键词 |
|---|---|---|
| Discover(发现) | 根据市场、策略类型、筛选条件或刷新上下文推荐AIHub机器人策略 | |
| Spot Grid(现货网格) | 手动创建现货网格 | |
| Margin Grid(杠杆网格) | 手动创建杠杆网格 | |
| Infinite Grid(无限网格) | 手动创建无限网格 | |
| Futures Grid(合约网格) | 手动创建合约网格 | |
| Spot Martingale(现货马丁格尔) | 手动创建现货马丁格尔策略 | |
| Contract Martingale(合约马丁格尔) | 手动创建合约马丁格尔策略 | |
| Portfolio List(组合列表) | 列出运行中的策略 | |
| Portfolio Detail(组合详情) | 查询单个策略详情 | |
| Portfolio Stop(组合停止) | 停止一个运行中的策略 | |
Routing Rules
路由规则
| Intent | Example phrases | Route to |
|---|---|---|
| Strategy recommendation | "Recommend a BTC strategy", "Give me a spot grid recommendation", "Refresh that recommendation" | Read |
| Spot grid create | "Create a BTC spot grid from 60000 to 72000 with 50 grids and 1000 USDT" | Read |
| Margin grid create | "Create a margin grid with 3x leverage and 50 grids" | Read |
| Infinite grid create | "Create a BTC infinite grid with 1.5% profit per grid" | Read |
| Futures grid create | "Create a BTC futures grid with 5x leverage and neutral direction" | Read |
| Spot martingale create | "Create a spot martingale that adds after a 2% drop" | Read |
| Contract martingale create | "Create a contract martingale, 5x leverage, short bias" | Read |
| Running list | "What bots do I have running?" | Read |
| Strategy detail | "Show me that bot's detailed P&L" | Read |
| Stop strategy | "Stop that BTC grid bot" | Read |
| 意图 | 示例短语 | 路由至 |
|---|---|---|
| 策略推荐 | "推荐一个BTC策略", "给我一个现货网格推荐", "刷新那个推荐" | 阅读 |
| 创建现货网格 | "创建一个BTC现货网格,区间60000到72000,50个网格,1000 USDT" | 阅读 |
| 创建杠杆网格 | "创建一个3倍杠杆、50个网格的杠杆网格" | 阅读 |
| 创建无限网格 | "创建一个每个网格盈利1.5%的BTC无限网格" | 阅读 |
| 创建合约网格 | "创建一个5倍杠杆、中性方向的BTC合约网格" | 阅读 |
| 创建现货马丁格尔 | "创建一个下跌2%后加仓的现货马丁格尔策略" | 阅读 |
| 创建合约马丁格尔 | "创建一个合约马丁格尔策略,5倍杠杆,空头偏向" | 阅读 |
| 运行中列表 | "我有哪些机器人在运行?" | 阅读 |
| 策略详情 | "展示那个机器人的详细盈亏情况" | 阅读 |
| 停止策略 | "停止那个BTC网格机器人" | 阅读 |
gate-cli Command Index
gate-cli命令索引
| # | Command | Purpose |
|---|---|---|
| 1 | | Discover recommendations for |
| 2 | | Create a manual spot grid |
| 3 | | Create a manual margin grid |
| 4 | | Create a manual infinite grid |
| 5 | | Create a manual futures grid |
| 6 | | Create a manual spot martingale |
| 7 | | Create a manual contract martingale |
| 8 | | List running strategies |
| 9 | | Query a single strategy detail |
| 10 | | Stop one strategy |
| 序号 | 命令 | 用途 |
|---|---|---|
| 1 | | 为 |
| 2 | | 创建手动现货网格 |
| 3 | | 创建手动杠杆网格 |
| 4 | | 创建手动无限网格 |
| 5 | | 创建手动合约网格 |
| 6 | | 创建手动现货马丁格尔策略 |
| 7 | | 创建手动合约马丁格尔策略 |
| 8 | | 列出运行中的策略 |
| 9 | | 查询单个策略详情 |
| 10 | | 停止一个策略 |
Execution Workflow
执行工作流
1. Intent classification
1. 意图分类
- Determine whether the request is discover, manual create, or portfolio.
- For manual create, resolve the exact bot type before reading the reference file.
- For portfolio, resolve whether the user wants list, detail, or stop.
- 判断请求属于发现、手动创建还是组合管理。
- 对于手动创建,在阅读参考文件前确定确切的机器人类型。
- 对于组合管理,确定用户需要列表、详情还是停止操作。
2. Parameter discipline
2. 参数规范
- Recommendation flows use query-style parameters only.
- Create and stop flows pass the final business payload through as a JSON string.
body - Any percentage-style input must be normalized exactly as required by the matched reference document before a write command is executed.
- 推荐流程仅使用查询式参数。
- 创建和停止流程通过****以JSON字符串形式传递最终业务负载。
body - 在执行写入命令之前,必须按照匹配的参考文档要求将任何百分比形式的输入标准化。
3. Scenario coverage
3. 场景覆盖
- Use as the publication-facing scenario index.
references/scenarios.md - Use the module-specific reference files as the source of detailed parameter and guardrail rules.
- 使用作为面向发布的场景索引。
references/scenarios.md - 使用模块特定的参考文件作为详细参数和防护规则的来源。
Safety Rules
安全规则
Confirmation
确认机制
- Recommendation and read-only portfolio queries do not require confirmation.
- Every write path must first present an action draft or confirmation summary.
- Each create or stop action must be confirmed separately by the user in the immediately following turn.
- If the user does not explicitly confirm, do not execute the write command.
- 推荐和只读组合查询无需确认。
- 每个写入路径必须先呈现操作草稿或确认摘要。
- 每个创建或停止操作必须由用户在紧接着的对话轮次中单独确认。
- 如果用户未明确确认,请勿执行写入命令。
Verification
验证规则
- Do not judge success from HTTP alone.
200 - Always inspect the returned payload ,
code, and keymessagefields.data - If a write fails, return the backend faithfully rather than inventing thresholds or hidden restrictions.
message
- 不能仅通过HTTP 状态码判断操作成功。
200 - 必须始终检查返回负载的、
code和关键message字段。data - 如果写入操作失败,如实返回后端的,而非自行设定阈值或隐藏限制。
message
Error Handling
错误处理
- Authentication or permission failure: stop writes and direct the operator to or host-side credential recovery.
gate-cli config init - Missing or ambiguous business inputs: ask only for the missing fields; do not guess them.
- Invalid backend payload or business-rule rejection: surface the backend and keep the flow blocked until corrected.
message - Ambiguous stop target: switch to running-list selection before attempting a stop.
- 身份验证或权限失败:停止写入操作,引导操作员执行或在主机端恢复凭据。
gate-cli config init - 缺失或模糊的业务输入:仅询问缺失的字段;请勿猜测。
- 无效的后端负载或业务规则拒绝:显示后端的,并在问题解决前阻止流程继续。
message - 模糊的停止目标:在尝试停止前切换到运行中列表选择流程。
Data and Privacy
数据与隐私
- User prompts, strategy parameters, and command payloads flow through the host runtime, , and Gate APIs needed for the requested bot action.
gate-cli - This skill does not define any extra telemetry, analytics, or custom persistence mechanism of its own.
- Local shell history, terminal logs, or host-side audit logs may still exist depending on the operator environment.
- Never ask the user to paste API secrets into chat. Credentials should be configured via or equivalent secure host-side environment management.
gate-cli config init
- 用户提示、策略参数和命令负载会通过主机运行时、和Gate API传递,以完成请求的机器人操作。
gate-cli - 本技能未定义任何额外的遥测、分析或自定义持久化机制。
- 根据操作员环境的不同,可能仍存在本地shell历史、终端日志或主机端审计日志。
- 切勿要求用户在聊天中粘贴API密钥。凭据应通过或等效的安全主机端环境管理方式配置。
gate-cli config init
Important Boundaries
重要边界
- Do not turn education-only or consultation-only questions into writes.
- Do not guess core strategy parameters such as range, grid count, leverage, direction, martingale deviation, or stop-loss ratio.
- Bulk stop is not supported. Ambiguous stop requests must go through running-list selection and then single-strategy confirmation.
- Advanced running-strategy management beyond recommendation, create, list, detail, and single stop remains out of scope unless explicitly documented in a reference file.
- 不得将仅用于教育或咨询的问题转换为写入操作。
- 不得猜测核心策略参数,如区间、网格数量、杠杆、方向、马丁格尔偏差或止损比率。
- 不支持批量停止。模糊的停止请求必须先经过运行中列表选择,再进行单策略确认。
- 除推荐、创建、列表、详情和单策略停止之外的高级运行中策略管理,除非在参考文件中明确记录,否则均不在范围内。