gate-exchange-trading
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResolving 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.mdGate 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/manageIt 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 commands explicitly listed in this skill. Commands not documented here must NOT be run for these workflows, even if other interfaces expose them.
gate-cli
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 commands as the baseline:
gate-cli cex …- -> Gate Info MCP
info_* - -> Gate News MCP
news_feed_* - read-only spot/futures market data -> /
gate-cli cex spot market …(public endpoints where applicable)gate-cli cex futures market … - private order / account / position flows -> authenticated (
gate-cli/GATE_API_KEYand/orGATE_API_SECRET; when both env vars are set on the host,gate-cli config initis not required)config init
Do not make a required dependency in scenario design, because it is not part of the documented baseline news surface.
news_events_*⚠️ 停止操作 — 继续前必须阅读并严格遵守共享运行时规则。
在未读完所有规则前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读 gate-runtime-rules.md
- 仅使用本技能中明确列出的命令。即使其他接口支持,也不得运行本工作流未记录的命令。
gate-cli
在调用任何指定的MCP工具前,请确认具体工具名称存在于当前运行时工具列表中。若辅助工具缺失,请告知不匹配情况,仅使用最接近的有效替代组合,不得夸大不具备的功能,如排名、宏观广度或自动资金流向追踪。
同时需验证返回的 payload 是否足够支撑预期的分析结论。若工具返回稀疏元数据、空结构或需要缺失的消歧输入,则仅将其视为辅助上下文,而非主要证据。
为实现跨主机可移植性,将文档中记录的命令作为基准:
gate-cli cex …- -> Gate Info MCP
info_* - -> Gate News MCP
news_feed_* - 只读现货/期货市场数据 -> /
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 , then execute this skill's trading workflow.
references/gate-cli.md- keeps composite routing, trade lifecycle policy, and guardrails.
SKILL.md - is the authoritative
references/gate-cli.mdorchestration contract for cross-domain tool sequencing, execution gates, and degradation.gate-cli
Read for:
references/scenarios.md- 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 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 — e.g. both
gate-cli config initandGATE_API_KEYset on the host, orGATE_API_SECRET/--api-keywhere supported — never ask the user to paste secrets into chat.--api-secret - API Key Required: Not always
- Read-only analysis: public ,
info_*, and some publicnews_feed_*/gate-cli cex spot market …reads may work without authentication, depending on endpointgate-cli cex futures market … - 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**完成API密钥、密钥、配置文件和默认设置的向导配置(参考 gate-cli)。gate-cli config init - 环境变量/参数: 当已提供凭证时,无需执行**** — 例如主机上已同时设置**
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: (install from gate-cli releases or via your environment’s Gate MCP / skills installer).
gate-cli - Add the directory containing to
gate-cliwhen invoking by name.PATH - Credentials: When and
GATE_API_KEYare both set (non-empty) for the host, do not requireGATE_API_SECRET. When both are unset or empty and private execution is needed, remind the operator to rungate-cli config initor to configuregate-cli config init/GATE_API_KEYin the matching skill from the skill library (never ask the user to paste secrets into chat).GATE_API_SECRET - Sanity check: Confirm the CLI works (e.g. or a public
gate-cli --version/gate-cli cex spot market …read) before private trading steps.gate-cli cex futures market …
- 必需组件: (从 gate-cli releases 安装,或通过环境中的Gate MCP/技能安装程序安装)。
gate-cli - 调用时需将包含**的目录添加到
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 draftI 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 buyingThis 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
本技能可实现
- Recognize whether the user wants:
- pre-trade judgment
- judgment plus execution
- order / position management
- 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
- Produce a Trading Brief
- Produce an Order Draft when risk is acceptable
- Execute after explicit confirmation:
- spot buy/sell, conditional limit logic, amend/cancel/verification
- USDT perpetual open/close/reverse/amend/cancel
- Continue after execution:
- fill verification
- position verification
- order / position management
- 识别用户需求类型:
- 交易前判断
- 判断加执行
- 订单/持仓管理
- 围绕单个交易目标动态组合分析模块:
- 市场/新闻背景
- 单币种分析
- 技术分析
- 流动性/滑点/清算/订单簿分析
- 代币或合约风险检查
- 生成交易简报
- 当风险可控时生成订单草案
- 获得明确确认后执行:
- 现货买卖、条件限价逻辑、修改/取消/验证
- USDT永续合约开仓/平仓/反向/修改/取消
- 执行后跟进:
- 成交验证
- 持仓验证
- 订单/持仓管理
This skill cannot do
本技能无法实现
- Decide and trade automatically on behalf of the user
- Place orders without explicit confirmation
- Bypass compliance, risk, minimum order, or contract safety constraints
- Promise profit or present analysis as certainty
- Pretend to support unsupported products
- 代表用户自动决策并交易
- 未获得明确确认就下单
- 绕过合规、风险、最低订单或合约安全限制
- 承诺盈利或将分析结果表述为确定性结论
- 假装支持未涵盖的产品
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 for:
references/routing-and-analysis.md- 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:
- Produce a
Trading Brief - Produce an
Order Draft - Wait for explicit confirmation in the immediately previous user turn
- Execute only after confirmation
Read for:
references/execution-and-guardrails.md- spot and futures execution rules
- execution MCP mapping
- draft requirements
- confirmation rules
- hard and soft blocks
任何实际交易操作必须遵循以下顺序:
- 生成
交易简报 - 生成
订单草案 - 等待用户上一轮对话中的明确确认
- 仅在获得确认后执行
阅读了解:
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:
- Trade Decision
- analyze first, then decide whether to trade
- Trade Draft / Execute
- the user already wants to trade and wants analysis plus draft plus execution
- Order / Position Management
- the user wants to manage an existing order or position
将用户请求归类为以下模式之一:
- 交易决策
- 先分析,再决定是否交易
- 交易草案/执行
- 用户已明确想要交易,需要分析+草案+执行
- 订单/持仓管理
- 用户想要管理现有订单或持仓
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- what the user wants to do
- current market/asset judgment
- key risks
- whether the skill should continue to order drafting
Only three result states are allowed:
- = safe enough to continue to order drafting
GO - = meaningful risk exists, but drafting may continue after warning
CAUTION - = do not continue into order drafting
BLOCK
交易简报- 用户需求
- 当前市场/资产判断
- 关键风险
- 是否应继续生成订单草案
仅允许三种结果状态:
- = 风险可控,可继续生成订单草案
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 without specifying market
buy BTC- 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
执行前
Trading Brief- if allowed:
Order Draft - wait for confirmation
交易简报- 若允许:
订单草案 - 等待确认
After execution
执行后
Execution Result- if needed:
Next Actions
执行结果- 若需要:
后续操作建议
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
阅读顺序
- Read
references/routing-and-analysis.md - Read
references/execution-and-guardrails.md - Execute only the modules needed for the current task; do not run the full stack by default
- 阅读
references/routing-and-analysis.md - 阅读
references/execution-and-guardrails.md - 仅执行当前任务所需的模块;默认情况下请勿运行全栈模块