gate-exchange-trading

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Resolving
gate-cli
(binary path)

解析
gate-cli
(二进制文件路径)

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
§4 (or
gate-runtime-rules.md
§4).
按以下顺序解析**
gate-cli
(1)**
command -v gate-cli
gate-cli --version
执行成功;(2) 若**
${HOME}/.local/bin/gate-cli
可执行则使用该路径;(3)** 若**
${HOME}/.openclaw/skills/bin/gate-cli
**可执行则使用该路径。标准规则参考:
exchange-runtime-rules.md
第4节(或
gate-runtime-rules.md
第4节)。

Gate Exchange Trading

Gate交易所交易技能

This is an L2 composite skill for users who want a single skill to complete the full trading loop:
judge the opportunity -> control risk -> produce order draft -> explicit confirmation -> execute -> verify/manage
It is neither a pure research skill nor a pure execution skill. Its purpose is to provide a complete trading workflow inside one skill.
这是一款L2复合技能,面向希望通过单一技能完成完整交易闭环的用户:
判断交易机会 -> 风险控制 -> 生成订单草案 -> 明确确认 -> 执行交易 -> 验证/管理
它既非纯研究类技能,也非纯执行类技能,旨在将完整交易工作流整合于单个技能中。

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 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.
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.
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.
For portability across hosts, treat the documented
gate-cli cex …
commands as the baseline:
  • info_*
    -> Gate Info MCP
  • news_feed_*
    -> Gate News MCP
  • read-only spot/futures market data ->
    gate-cli cex spot market …
    /
    gate-cli cex futures market …
    (public endpoints where applicable)
  • 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)
Do not make
news_events_*
a required dependency in scenario design, because it is not part of the documented baseline news surface.
⚠️ 停止操作 — 继续前必须阅读并严格遵守共享运行时规则。 在未读完所有规则前,请勿选择或调用任何工具。这些规则具有最高优先级。 → 阅读 gate-runtime-rules.md
  • 仅使用本技能中明确列出的
    gate-cli
    命令
    。即使其他接口支持,也不得运行本工作流未记录的命令。
在调用任何指定的MCP工具前,请确认具体工具名称存在于当前运行时工具列表中。若辅助工具缺失,请告知不匹配情况,仅使用最接近的有效替代组合,不得夸大不具备的功能,如排名、宏观广度或自动资金流向追踪。
同时需验证返回的 payload 是否足够支撑预期的分析结论。若工具返回稀疏元数据、空结构或需要缺失的消歧输入,则仅将其视为辅助上下文,而非主要证据。
为实现跨主机可移植性,将文档中记录的
gate-cli cex …
命令作为基准:
  • info_*
    -> Gate Info MCP
  • news_feed_*
    -> Gate News MCP
  • 只读现货/期货市场数据 ->
    gate-cli cex spot market …
    /
    gate-cli cex futures market …
    (适用时使用公开端点)
  • 私有订单/账户/持仓流程 -> 已认证的
    gate-cli
    (需配置**
    GATE_API_KEY
    ** /
    GATE_API_SECRET
    和/或执行**
    gate-cli config init
    ;当主机上同时设置了两个环境变量时,无需执行
    config init
    **)
在场景设计中,请勿将
news_events_*
设为必需依赖,因为它不属于文档记录的基准新闻模块。

Execution mode

执行模式

Read and strictly follow
references/gate-cli.md
, then execute this skill's trading workflow.
  • SKILL.md
    keeps composite routing, trade lifecycle policy, and guardrails.
  • references/gate-cli.md
    is the authoritative
    gate-cli
    orchestration contract for cross-domain tool sequencing, execution gates, and degradation.

Read
references/scenarios.md
for:
  • representative user scenarios
  • representative prompt examples
  • expected tool-routing patterns
阅读并严格遵循
references/gate-cli.md
,然后执行本技能的交易工作流。
  • SKILL.md
    包含复合路由、交易生命周期策略和防护规则。
  • references/gate-cli.md
    gate-cli
    编排的权威约定,涵盖跨域工具排序、执行闸门和降级处理。

阅读
references/scenarios.md
了解:
  • 典型用户场景
  • 典型提示示例
  • 预期工具路由模式

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).
  • 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.
  • API Key Required: Not always
  • Read-only analysis: public
    info_*
    ,
    news_feed_*
    , and some public
    gate-cli cex spot market …
    /
    gate-cli cex futures market …
    reads may work without authentication, depending on endpoint
  • Execution and private account actions: Yes, authenticated Exchange MCP tools with the required API key permissions are mandatory
  • Note: Do not block analysis-only use just because private execution tools are unavailable; only block when the requested action needs private trading/account access.
  • 交互式文件配置: 当主机上未同时设置**
    GATE_API_KEY
    GATE_API_SECRET
    时,运行
    gate-cli config init
    **完成API密钥、密钥、配置文件和默认设置的向导配置(参考 gate-cli)。
  • 环境变量/参数: 当已提供凭证时,无需执行**
    gate-cli config init
    ** — 例如主机上已同时设置**
    GATE_API_KEY
    GATE_API_SECRET
    ,或在支持的情况下使用
    --api-key
    ** / **
    --api-secret
    **参数 — 切勿要求用户在聊天中粘贴密钥。
  • API密钥要求:并非始终需要
  • 只读分析:公开的
    info_*
    news_feed_*
    以及部分公开的
    gate-cli cex spot market …
    /
    gate-cli cex futures market …
    读取操作可能无需认证,具体取决于端点
  • 执行和私有账户操作:需要,必须使用具备所需API密钥权限的已认证Exchange MCP工具
  • 注意:请勿因私有执行工具不可用而阻止仅分析用途;仅当请求的操作需要私有交易/账户访问权限时才阻止。

Installation Check

安装检查

  • Required:
    gate-cli
    (install from gate-cli releases or via your environment’s Gate MCP / skills installer).
  • Add the directory containing
    gate-cli
    to
    PATH
    when invoking by name.
  • 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 and private execution is needed, remind the operator to run
    gate-cli config init
    or to configure
    GATE_API_KEY
    /
    GATE_API_SECRET
    in the matching skill from the skill library (never ask the user to paste secrets into chat).
  • Sanity check: Confirm the CLI works (e.g.
    gate-cli --version
    or a public
    gate-cli cex spot market …
    /
    gate-cli cex futures market …
    read) before private trading steps.
  • 必需组件:
    gate-cli
    (从 gate-cli releases 安装,或通过环境中的Gate MCP/技能安装程序安装)。
  • 调用时需将包含**
    gate-cli
    的目录添加到
    PATH
    **环境变量中。
  • 凭证: 当主机上同时设置(非空)
    GATE_API_KEY
    GATE_API_SECRET
    时,无需要求执行
    gate-cli config init
    。当两者均未设置或为空且需要私有执行时,提醒操作者运行**
    gate-cli config init
    ** 从技能库中配置匹配技能的**
    GATE_API_KEY
    ** /
    GATE_API_SECRET
    (切勿要求用户在聊天中粘贴密钥)。
  • 完整性检查: 在进行私有交易步骤前,确认CLI可用(例如执行**
    gate-cli --version
    或公开的
    gate-cli cex spot market …
    ** / **
    gate-cli cex futures market …
    **读取操作)。

Positioning

定位

  • For users who want to trade without switching across multiple skills
  • Self-contained: can be installed alone and still understand both analysis and execution mapping
  • Supports spot trading and USDT perpetual futures
  • Supports post-trade amend / cancel / close / verification
  • 面向无需切换多个技能即可完成交易的用户
  • 独立完整:可单独安装,同时支持分析与执行映射
  • 支持现货交易USDT永续期货
  • 支持交易后修改/取消/平仓/验证

Suitable Scenarios

适用场景

Suitable

适用场景

  • The user already has a target asset and wants analysis before trading
    • Check whether BTC is worth buying now, then give me a spot order draft
    • I want to long ETH, but check momentum, liquidation, and liquidity first
  • The user is triggered by news, abnormal moves, or new listings and wants to trade after analysis
    • ETH just dumped. Explain why and tell me whether it is worth buying
    • This newly listed coin looks interesting. Check the risk before giving me a starter trade plan
  • The user already placed an order or opened a position and now wants management
    • Raise my unfilled buy order by 1%
    • Close half of my BTC position
  • 用户已有目标资产,希望在交易前进行分析
    • 判断现在是否值得买入BTC,然后给我一份现货订单草案
    • 我想做多ETH,但先检查动量、清算和流动性情况
  • 用户因新闻、异常波动或新上线币种触发交易需求,希望分析后再交易
    • ETH刚暴跌,解释原因并告诉我是否值得买入
    • 这个新上线的币种看起来不错,先检查风险再给我一份初始交易计划
  • 用户已下单或开仓,现在需要进行管理
    • 将我未成交的买入订单提高1%
    • 平掉我一半的BTC持仓

Not Suitable

不适用场景

  • Pure market research with no trading goal
  • Options, Alpha trading, on-chain swap, DeFi execution, copy trading, wealth products
  • Fully automatic trading, skipping confirmation, bypassing compliance or risk controls
  • 无交易目标的纯市场研究
  • 期权、Alpha交易、链上兑换、DeFi执行、跟单交易、理财产品
  • 全自动交易、跳过确认、绕过合规或风险控制

Capability Boundary

能力边界

This skill can do

本技能可实现

  1. Recognize whether the user wants:
    • pre-trade judgment
    • judgment plus execution
    • order / position management
  2. Dynamically combine analysis modules around one trade target:
    • market/news context
    • single-coin analysis
    • technical analysis
    • liquidity/slippage/liquidation/order-book analysis
    • token or contract risk check
  3. Produce a Trading Brief
  4. Produce an Order Draft when risk is acceptable
  5. Execute after explicit confirmation:
    • spot buy/sell, conditional limit logic, amend/cancel/verification
    • USDT perpetual open/close/reverse/amend/cancel
  6. Continue after execution:
    • fill verification
    • position verification
    • order / position management
  1. 识别用户需求类型:
    • 交易前判断
    • 判断加执行
    • 订单/持仓管理
  2. 围绕单个交易目标动态组合分析模块:
    • 市场/新闻背景
    • 单币种分析
    • 技术分析
    • 流动性/滑点/清算/订单簿分析
    • 代币或合约风险检查
  3. 生成交易简报
  4. 当风险可控时生成订单草案
  5. 获得明确确认后执行:
    • 现货买卖、条件限价逻辑、修改/取消/验证
    • USDT永续合约开仓/平仓/反向/修改/取消
  6. 执行后跟进:
    • 成交验证
    • 持仓验证
    • 订单/持仓管理

This skill cannot do

本技能无法实现

  1. Decide and trade automatically on behalf of the user
  2. Place orders without explicit confirmation
  3. Bypass compliance, risk, minimum order, or contract safety constraints
  4. Promise profit or present analysis as certainty
  5. Pretend to support unsupported products
  1. 代表用户自动决策并交易
  2. 未获得明确确认就下单
  3. 绕过合规、风险、最低订单或合约安全限制
  4. 承诺盈利或将分析结果表述为确定性结论
  5. 假装支持未涵盖的产品

Operating Principles

操作原则

Principle 1: Work around the trading goal

原则1:围绕交易目标开展工作

This skill is built for trading closure, not broad research.
  • If the user only asks
    How is the market?
    • a lightweight market scan is fine
    • do not proactively move into order execution
  • If the user says
    How is the market today? Give me one trade idea
    • a lightweight scan is allowed
    • but the workflow must narrow down to one asset + one market (spot or futures) before entering execution
本技能为完成交易闭环而构建,而非用于广泛研究。
  • 如果用户仅询问
    市场情况如何?
    • 可进行轻量级市场扫描
    • 请勿主动推进至订单执行环节
  • 如果用户说
    今天市场怎么样?给我一个交易思路
    • 可进行轻量级扫描
    • 但工作流必须先缩小到一种资产 + 一个市场(现货或期货),再进入执行环节

Principle 2: Judge first, execute second

原则2:先判断,后执行

Unless the user only wants pure order/position management, default to one round of pre-trade judgment before producing an order draft.
除非用户仅需要纯订单/持仓管理,否则默认在生成订单草案前进行一轮交易前判断。

Principle 3: Use the minimum necessary analysis

原则3:仅进行必要的最小化分析

Do not run every module every time. Only call the modules needed for the current decision.
Read
references/routing-and-analysis.md
for:
  • intent routing
  • analysis module selection by scenario
  • risk gating
  • module-to-MCP mapping and call patterns
无需每次运行所有模块。仅调用当前决策所需的模块。
阅读
references/routing-and-analysis.md
了解:
  • 意图路由
  • 按场景选择分析模块
  • 风险闸门
  • 模块到MCP的映射及调用模式

Principle 4: Strong confirmation at execution layer

原则4:执行层需强确认

Any real trading action must follow this order:
  1. Produce a
    Trading Brief
  2. Produce an
    Order Draft
  3. Wait for explicit confirmation in the immediately previous user turn
  4. Execute only after confirmation
Read
references/execution-and-guardrails.md
for:
  • spot and futures execution rules
  • execution MCP mapping
  • draft requirements
  • confirmation rules
  • hard and soft blocks
任何实际交易操作必须遵循以下顺序:
  1. 生成
    交易简报
  2. 生成
    订单草案
  3. 等待用户上一轮对话中的明确确认
  4. 仅在获得确认后执行
阅读
references/execution-and-guardrails.md
了解:
  • 现货和期货执行规则
  • 执行MCP映射
  • 草案要求
  • 确认规则
  • 硬性和软性拦截

Overall Workflow

整体工作流

Step 0: Apply the shared runtime rules first

步骤0:先应用共享运行时规则

Before analysis or execution:
  • read and follow gate-runtime-rules.md
  • resolve any required runtime, update, or authorization gate before continuing
  • verify that the named tools you plan to call exist in the current runtime before relying on them
在分析或执行前:
  • 阅读并遵循 gate-runtime-rules.md
  • 解决任何所需的运行时、更新或授权问题后再继续
  • 在依赖工具前,确认计划调用的指定工具存在于当前运行时中

Step 1: Identify task mode

步骤1:识别任务模式

Classify the user request into one of these modes:
  1. Trade Decision
    • analyze first, then decide whether to trade
  2. Trade Draft / Execute
    • the user already wants to trade and wants analysis plus draft plus execution
  3. Order / Position Management
    • the user wants to manage an existing order or position
将用户请求归类为以下模式之一:
  1. 交易决策
    • 先分析,再决定是否交易
  2. 交易草案/执行
    • 用户已明确想要交易,需要分析+草案+执行
  3. 订单/持仓管理
    • 用户想要管理现有订单或持仓

Step 2: Narrow down to one trade target

步骤2:缩小到单个交易目标

Before entering execution, try to make these explicit:
  • asset: BTC / ETH / SOL / a new coin / a futures contract
  • market: spot or USDT perpetual
  • direction: buy / sell / long / short / close
If information is still incomplete:
  • a lightweight market scan is allowed
  • but before producing an order draft, the workflow must narrow down to one asset and one market
进入执行环节前,需明确以下信息:
  • 资产:BTC / ETH / SOL / 新币种 / 期货合约
  • 市场:现货或USDT永续合约
  • 方向:买入/卖出/做多/做空/平仓
若信息仍不完整:
  • 可进行轻量级市场扫描
  • 但在生成订单草案前,工作流必须缩小到一种资产和一个市场

Step 3: Build the pre-trade analysis package

步骤3:构建交易前分析包

Call only the modules needed for this request:
  • market overview / news briefing
  • listing / exchange announcement context
  • single-coin analysis
  • technical analysis
  • event explanation
  • risk check
  • address tracing (only when the user really provides an address and wants tracing)
  • liquidity / slippage / momentum / liquidation / basis / order-book analysis
仅调用当前请求所需的模块:
  • 市场概览/新闻简报
  • 上线/交易所公告背景
  • 单币种分析
  • 技术分析
  • 事件解读
  • 风险检查
  • 地址追踪(仅当用户提供地址并明确要求追踪时)
  • 流动性/滑点/动量/清算/基差/订单簿分析

Step 4: Produce a Trading Brief

步骤4:生成交易简报

Trading Brief
is the mandatory intermediate artifact before execution. It must include:
  1. what the user wants to do
  2. current market/asset judgment
  3. key risks
  4. whether the skill should continue to order drafting
Only three result states are allowed:
  • GO
    = safe enough to continue to order drafting
  • CAUTION
    = meaningful risk exists, but drafting may continue after warning
  • BLOCK
    = do not continue into order drafting
交易简报
是执行前的必需中间产物,必须包含:
  1. 用户需求
  2. 当前市场/资产判断
  3. 关键风险
  4. 是否应继续生成订单草案
仅允许三种结果状态:
  • GO
    = 风险可控,可继续生成订单草案
  • CAUTION
    = 存在显著风险,但发出警告后可继续生成草案
  • BLOCK
    = 不得继续生成订单草案

Step 5: Produce an Order Draft

步骤5:生成订单草案

Only produce an order draft when all of the following are true:
  • the user has real trading intent
  • the trade target is sufficiently clear
  • no hard block is triggered
仅在满足以下所有条件时生成订单草案:
  • 用户有真实交易意图
  • 交易目标足够明确
  • 未触发硬性拦截

Step 6: Wait for explicit confirmation

步骤6:等待明确确认

If the user does not provide a clear, immediate confirmation:
  • do not execute
  • remain in analysis / draft / query mode only
若用户未提供清晰、即时的确认:
  • 请勿执行
  • 仅停留在分析/草案/查询模式

Step 7: Execute and verify

步骤7:执行并验证

After execution, always return:
  • whether execution succeeded
  • core fill/order/position results
  • reasonable next actions, such as verify fill, amend, cancel, or close
执行完成后,必须返回:
  • 执行是否成功
  • 核心成交/订单/持仓结果
  • 合理的后续操作建议,如验证成交、修改、取消或平仓

Market Identification Rules

市场识别规则

Default behavior

默认行为

  • If the request clearly contains
    long / short / leverage / contract / perp / futures / open / close
    • route to USDT perpetual futures
  • If the request clearly contains
    buy coin / sell coin / spot / buy BTC / sell ETH
    • route to spot
  • If the user says
    buy BTC
    without specifying market
    • default to spot
  • If the user says
    trade this move
    • ask whether they want spot or USDT perpetual futures
  • 若请求明确包含
    做多/做空/杠杆/合约/永续/期货/开仓/平仓
    • 路由至USDT永续期货
  • 若请求明确包含
    买币/卖币/现货/买入BTC/卖出ETH
    • 路由至现货
  • 若用户仅说
    买入BTC
    未指定市场
    • 默认选择现货
  • 若用户说
    针对这波行情交易
    • 询问用户想要现货还是USDT永续期货

Recommended Output Rhythm

推荐输出节奏

Before execution

执行前

  1. Trading Brief
  2. if allowed:
    Order Draft
  3. wait for confirmation
  1. 交易简报
  2. 若允许:
    订单草案
  3. 等待确认

After execution

执行后

  1. Execution Result
  2. if needed:
    Next Actions
  1. 执行结果
  2. 若需要:
    后续操作建议

Special Rule for Order / Position Management

订单/持仓管理特殊规则

If the user asks for:
  • amend order
  • cancel order
  • verify fill
  • close half
  • close all
  • reverse
then the skill does not need to rerun the full research chain, but it still must:
  • locate the correct target order or position
  • apply the corresponding execution rules
  • require strong confirmation for high-risk actions
若用户请求:
  • 修改订单
  • 取消订单
  • 验证成交
  • 平半仓
  • 全平仓
  • 反向操作
则本技能无需重新运行完整研究链,但仍必须:
  • 定位正确的目标订单或持仓
  • 应用相应的执行规则
  • 高风险操作需强确认

Risk Policy

风险策略

Hard blocks

硬性拦截

Must stop immediately if:
  • the user asks to skip confirmation
  • the user asks to bypass compliance or risk controls
  • the product is unsupported
  • the asset is not tradable
  • token security check shows a critical malicious risk
若出现以下情况必须立即停止:
  • 用户要求跳过确认
  • 用户要求绕过合规或风险控制
  • 产品未被支持
  • 资产不可交易
  • 代币安全检查显示存在严重恶意风险

Soft blocks

软性拦截

Warn but allow continuation if:
  • liquidity is poor
  • slippage is high
  • funding is extreme
  • crowding/liquidation risk is elevated
  • a major event just hit and direction is unstable
  • the coin is newly listed or still in price discovery
For soft blocks:
  • surface the warning clearly in
    Trading Brief
  • if the user still wants to continue, drafting is allowed
  • confirmation is still mandatory
若出现以下情况需发出警告但允许继续:
  • 流动性不足
  • 滑点较高
  • 资金费率极端
  • 拥挤/清算风险上升
  • 刚发生重大事件且行情方向不稳定
  • 币种刚上线仍处于价格发现阶段
对于软性拦截:
  • 交易简报
    中清晰展示警告
  • 若用户仍希望继续,允许生成草案
  • 仍需强制确认

Reading Order

阅读顺序

  1. Read
    references/routing-and-analysis.md
  2. Read
    references/execution-and-guardrails.md
  3. Execute only the modules needed for the current task; do not run the full stack by default
  1. 阅读
    references/routing-and-analysis.md
  2. 阅读
    references/execution-and-guardrails.md
  3. 仅执行当前任务所需的模块;默认情况下请勿运行全栈模块