gate-exchange-autoinvest
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-autoinvest
gate-exchange-autoinvest
The fast auto-invest (DCA) function of Gate Exchange Earn, supporting create, update, stop plans, and query related information.
Gate交易所Earn板块的快速自动投资(DCA)功能,支持创建、更新、停止计划及查询相关信息。
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 first (mirror: on GitHub).
exchange-runtime-rules.mdexchange-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
⚠️ 停止操作——在继续之前,你必须阅读并严格遵守共享运行时规则。在读完所有规则之前,不要选择或调用任何工具。这些规则具有最高优先级。
→ 首先阅读(镜像:GitHub上的)。
exchange-runtime-rules.mdexchange-runtime-rules.md- 仅使用本技能中明确列出的命令。即使其他接口提供了未在此处记录的命令,也不得在这些工作流中运行。
gate-cli
Skill Dependencies
技能依赖
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 - Permissions: Earn (auto-invest) access as required by your API key and deployment.
- 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密钥和部署需具备Earn(自动投资)访问权限。
- 入口:在聊天外创建或轮换密钥:https://www.gate.com/myaccount/profile/api-key/manage
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, 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 read-only earn/auto-invest query from this skill) before plan mutations.
gate-cli --version
- 必需组件:(从gate-cli发布页安装,或通过环境中的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可正常工作(例如运行****或本技能中的只读Earn/自动投资查询命令)。
gate-cli --version
Risk Disclaimer
风险声明
Digital Asset Trading Risk Statement:
Digital asset trading carries significant risks. Prices are subject to high volatility and market manipulation. Past performance is not indicative of future results. This skill provides informational tools only and does not constitute investment advice. Users are solely responsible for their investment decisions. Only invest what you can afford to lose. For full risk disclosure, please visit Gate's official website.
数字资产交易风险提示:
数字资产交易存在重大风险。价格波动剧烈,且可能受到市场操纵。过往业绩不代表未来结果。本技能仅提供信息工具,不构成投资建议。用户需对自身投资决策负全部责任。仅投资可承受损失的金额。完整风险披露请访问Gate官方网站。
AI Interaction Data Flow
AI交互数据流
Data Handling Notice:
When you use this skill, your queries and account data are processed through AI systems to provide trading assistance. This includes:
- Your trading instructions and preferences
- Account balance and position information (read-only access)
- Historical trading records for context
Important:
- All data transmission is encrypted and follows Gate's privacy policy
- AI processes data in real-time; no long-term storage of your trading data by the AI
- You retain full control; AI only executes trades after your explicit confirmation
- For privacy details, see Gate's Privacy Policy
数据处理说明:
使用本技能时,你的查询和账户数据将通过AI系统处理以提供交易协助,包括:
- 你的交易指令和偏好
- 账户余额和持仓信息(只读访问)
- 历史交易记录用于上下文分析
重要提示:
- 所有数据传输均已加密,并遵循Gate隐私政策
- AI实时处理数据;AI不会长期存储你的交易数据
- 你拥有完全控制权;AI仅在你明确确认后执行交易
- 隐私详情请查看Gate隐私政策
Feature Modules
功能模块
| Module | Description | Trigger Keywords |
|---|---|---|
| Plan Management | Create, update, stop, and add position to auto-invest plans | |
| Information Query | Query supported coins, minimum amounts, execution records, order details, and plan details | |
| 模块 | 描述 | 触发关键词 |
|---|---|---|
| 计划管理 | 创建、更新、停止自动投资计划,以及追加投资 | |
| 信息查询 | 查询支持的币种、最低投资金额、执行记录、订单详情及计划详情 | |
Business Rules
业务规则
Investment Currency Restrictions
投资币种限制
- Only USDT or BTC supported as investment currency (the currency deducted each period)
- Target coins can be other assets
- 仅支持USDT或BTC作为投资币种(每期扣除的币种)
- 目标币种可以是其他资产
Create Plan Constraints
创建计划约束
Required Parameters:
- Target coins to invest (asset list)
- Investment amount per period
Optional Parameters (with defaults):
- Investment time: Defaults to daily at 10:00 (can be customized)
- Fund source: Defaults to (spot account)
spot - Fund flow: Defaults to (purchased assets remain in Spot account)
auto_invest
Execution Time Restriction:
- Auto-invest only supports execution on the hour (0-23 o'clock)
- must be an integer from 0 to 23
plan_period_hour - Minutes and seconds are not supported; all executions occur at :00
- ⚠️ CRITICAL - Time Zone: uses UTC time zone
plan_period_hour- When user specifies local time (e.g., "10:00 AM Beijing time"), convert to UTC before passing to API
- Example: Beijing 10:00 (UTC+8) → UTC 02:00 → set
plan_period_hour: 2 - Fallback: If system time zone cannot be detected, use user's specified hour directly
- Always show both UTC and local time in confirmation (or note if time zone detection failed)
- See → Time Zone Handling section for detailed conversion rules
references/autoinvest-plans.md
plan_period_day- Required on create; value must not be . Full workflow:
0→ Workflow step 6.references/autoinvest-plans.md - By :
plan_period_type- : Day of month 1–30
monthly - or
weekly: Weekday 1–7 (1 = Monday, 7 = Sunday)biweekly - ,
daily, orhourly: Use4-hourly1
Investment Amount Limits:
- Minimum amount: Must be ≥ the value returned by
gate-cli cex earn auto-invest min-amount - Maximum amount: Must be ≤ the value returned by
gate-cli cex earn auto-invest config - Before creating a plan:
- Call to query the minimum amount
gate-cli cex earn auto-invest min-amount - Call to query the maximum amount
gate-cli cex earn auto-invest config - Validate that the user's input amount is within the valid range
- Call
Target Coins Constraints (for multi-target plans):
- Maximum target coins: A plan can have at most 10 target coins
- Minimum allocation per coin: Each target coin must have at least 10% allocation (ratio ≥ 10)
- Before creating a multi-target plan:
- Check that the number of target coins ≤ 10
- Check that each coin's ratio ≥ 10
- If validation fails, reject immediately with clear explanation
Fund Flow (where purchased assets go):
After creating a plan, purchased assets will flow to one of two destinations based on the parameter (API field: post-purchase destination):
fund_flowAPI | Meaning (EN) | Typical Gate app label (localized; may vary) |
|---|---|---|
| Simple Earn / flexible earn | Often labeled Simple Earn / flexible earn in English locales |
| Spot account (default) | Spot account |
- → Assets automatically transfer to Simple Earn to earn interest
fund_flow: "earn" - → Assets remain in Spot account for manual management (default)
fund_flow: "auto_invest"
Important:
- User should choose fund flow based on their investment strategy
- is recommended for passive income on accumulated assets
earn - is recommended if user plans to trade or withdraw assets frequently
auto_invest - When users refer to Simple Earn (flexible earn) or spot account in any language, map to or
earnrespectively when calling MCP create/updateauto_invest - Do not use angle brackets (or
<) in user-facing replies.>
必填参数:
- 投资的目标币种(资产列表)
- 每期投资金额
可选参数(含默认值):
- 投资时间:默认每日10:00 UTC(可自定义)
- 资金来源:默认(现货账户)
spot - 资金流向:默认(购买的资产保留在现货账户)
auto_invest
执行时间限制:
- 自动投资仅支持整点执行(0-23点)
- 必须是0到23之间的整数
plan_period_hour - 不支持分钟和秒;所有执行均在整点进行
- ⚠️ 关键提示 - 时区:使用UTC时区
plan_period_hour- 当用户指定本地时间(例如“北京时间上午10:00”)时,转换为UTC时间后再传递给API
- 示例:北京时间10:00(UTC+8)→ UTC 02:00 → 设置
plan_period_hour: 2 - 备选方案:如果无法检测系统时区,直接使用用户指定的小时数
- 在确认信息中始终显示UTC时间和本地时间(或注明时区检测失败)
- 详见→ 时区处理部分的详细转换规则
references/autoinvest-plans.md
plan_period_day- 创建计划时必填;值不能为。完整工作流:
0→ 工作流步骤6。references/autoinvest-plans.md - 根据****:
plan_period_type- :每月1–30日
monthly - 或
weekly:每周1–7日(1=周一,7=周日)biweekly - 、
daily或hourly:使用**4-hourly**1
投资金额限制:
- 最低金额:必须≥返回的值
gate-cli cex earn auto-invest min-amount - 最高金额:必须≤返回的值
gate-cli cex earn auto-invest config - 创建计划前:
- 调用查询最低金额
gate-cli cex earn auto-invest min-amount - 调用查询最高金额
gate-cli cex earn auto-invest config - 验证用户输入的金额是否在有效范围内
- 调用
目标币种约束(多目标计划):
- 最多目标币种数量:一个计划最多包含10个目标币种
- 单币种最低分配比例:每个目标币种的分配比例至少为10%(ratio≥10)
- 创建多目标计划前:
- 检查目标币种数量≤10
- 检查每个币种的比例≥10
- 如果验证失败,立即拒绝并给出明确说明
资金流向(购买资产的去向):
创建计划后,购买的资产将根据参数(API字段:购买后去向)流向以下两个目的地之一:
fund_flowAPI | 英文含义 | Gate应用典型标签(本地化,可能有所不同) |
|---|---|---|
| Simple Earn / 灵活理财 | 英文环境中通常标注为Simple Earn / flexible earn |
| 现货账户(默认) | 现货账户 |
- → 资产自动转入Simple Earn赚取利息
fund_flow: "earn" - → 资产保留在现货账户供手动管理(默认)
fund_flow: "auto_invest"
重要提示:
- 用户应根据自身投资策略选择资金流向
- 推荐给希望通过积累资产获得被动收入的用户
earn - 推荐给计划频繁交易或提取资产的用户
auto_invest - 当用户提及Simple Earn(灵活理财)或现货账户时,调用MCP创建/更新接口时分别映射为或
earnauto_invest - 用户回复中不要使用尖括号(或
<)。>
After Stopping a Plan
停止计划后
- After stopping a plan, automatic deductions will cease
- Purchased assets typically remain in the spot account
- 停止计划后,自动扣款将终止
- 已购买的资产通常保留在现货账户中
Next Purchase Time
下一次购买时间
- This function does not provide specific query for the next automatic purchase time
- For this information, please visit Gate App or website
- 本功能不提供下一次自动购买时间的查询
- 如需此信息,请访问Gate应用或官网
gate-cli command index
gate-cli命令索引
Auto-Invest Related Tools (11 tools)
自动投资相关工具(11个)
| # | Tool Name | Type | Function |
|---|---|---|---|
| 1 | | Write | Create a new auto-invest plan (See Create Plan Constraints) |
| 2 | | Write | Update an existing plan |
| 3 | | Write | Stop a plan (explicit user confirmation before call — same as other writes) |
| 4 | | Write ⚠️ | Add position immediately (Call only once after confirmation, strictly no repeated calls) |
| 5 | | Query | List user's auto-invest plans |
| 6 | | Query | View single plan details |
| 7 | | Query | Query supported target coins |
| 8 | | Query | Query minimum investment amount |
| 9 | | Query | Query plan execution records |
| 10 | | Query | Query order details |
| 11 | | Query | Query auto-invest configuration options |
| 序号 | 工具名称 | 类型 | 功能 |
|---|---|---|---|
| 1 | | 写入 | 创建新的自动投资计划(详见创建计划约束) |
| 2 | | 写入 | 更新现有计划 |
| 3 | | 写入 | 停止计划(调用前需用户明确确认——与其他写入操作相同) |
| 4 | | 写入 ⚠️ | 立即追加投资(确认后仅调用一次,严禁重复调用) |
| 5 | | 查询 | 列出用户的自动投资计划 |
| 6 | | 查询 | 查看单个计划详情 |
| 7 | | 查询 | 查询支持的目标币种 |
| 8 | | 查询 | 查询最低投资金额 |
| 9 | | 查询 | 查询计划执行记录 |
| 10 | | 查询 | 查询订单详情 |
| 11 | | 查询 | 查询自动投资配置选项 |
Supporting Tools
支持工具
| Tool Name | Function |
|---|---|
| Query spot account balance |
| Optional read-only context for Simple Earn / Uni balances when fund source or debits involve earn (see Execution → balance check) |
| 工具名称 | 功能 |
|---|---|
| 查询现货账户余额 |
| 当资金来源或扣款涉及Earn时,可选查询Simple Earn/Uni余额作为上下文(详见执行→余额检查) |
Query Function Usage
查询功能使用方法
Tool Mapping
工具映射
| User Request | Tool to Use |
|---|---|
| List my auto-invest plans | |
| View single plan details | |
| Query supported coins | |
| Query minimum investment amount | |
| View plan execution records | |
| View order details | |
| Query auto-invest config | |
| 用户请求 | 使用工具 |
|---|---|
| 列出我的自动投资计划 | |
| 查看单个计划详情 | |
| 查询支持的币种 | |
| 查询最低投资金额 | |
| 查看计划执行记录 | |
| 查看订单详情 | |
| 查询自动投资配置 | |
Common Query Scenarios
常见查询场景
Scenario 1: Query Supported Coins
场景1:查询支持的币种
Example Questions:
- "Which coins can I auto-invest in?"
- "What target coins does auto-invest support?"
Operation: Use the tool to query, which will return a list of all coins that support auto-invest.
gate-cli cex earn auto-invest coins示例问题:
- "我可以自动投资哪些币种?"
- "自动投资支持哪些目标币种?"
操作:使用工具查询,将返回所有支持自动投资的币种列表。
gate-cli cex earn auto-invest coinsScenario 2: Query Minimum Investment Amount
场景2:查询最低投资金额
Example Questions:
- "What's the minimum amount per period for USDT auto-invest?"
- "What's the minimum amount when BTC is the investment currency?"
Operation: Use the tool, need to specify the investment currency (USDT or BTC) and target coins.
gate-cli cex earn auto-invest min-amount示例问题:
- "USDT自动投资每期的最低金额是多少?"
- "以BTC为投资币种时,最低金额是多少?"
操作:使用工具,需指定投资币种(USDT或BTC)和目标币种。
gate-cli cex earn auto-invest min-amountScenario 3: View Execution History
场景3:查看执行历史
Example Questions:
- "How many times has my BTC auto-invest been executed recently?"
- "View the recent execution status of this plan"
Operation: Use to view execution records, use to view specific order details.
gate-cli cex earn auto-invest recordsgate-cli cex earn auto-invest ordersReturn Information Example:
📋 Auto-Invest Execution Records
- Plan: {Plan name or ID}
- Execution count: {count}
- Latest execution: {amount} {currency} → {target coin}示例问题:
- "我的BTC自动投资最近执行了多少次?"
- "查看这个计划的近期执行状态"
操作:使用查看执行记录,使用查看具体订单详情。
gate-cli cex earn auto-invest recordsgate-cli cex earn auto-invest orders返回信息示例:
📋 自动投资执行记录
- 计划:{计划名称或ID}
- 执行次数:{次数}
- 最近一次执行:{金额} {币种} → {目标币种}Scenario 4: Plan Not Found
场景4:未找到计划
Situation: No matching auto-invest plan found during query.
Prompt: No matching auto-invest plan found. You can create a new auto-invest plan.
情况:查询时未找到匹配的自动投资计划。
提示:未找到匹配的自动投资计划。你可以创建一个新的自动投资计划。
Other Query Functions
其他查询功能
- List all plans: Use to view all your auto-invest plans
gate-cli cex earn auto-invest plans - Query configuration: Use to view available auto-invest settings and preset options
gate-cli cex earn auto-invest config
- 列出所有计划:使用查看所有自动投资计划
gate-cli cex earn auto-invest plans - 查询配置:使用查看可用的自动投资设置和预设选项
gate-cli cex earn auto-invest config
Sub-Modules
子模块
| Module | Document | Purpose |
|---|---|---|
| Plan Management | | Create, update, stop, and top-up (add position) workflows with detailed scenarios |
| Compliance & Rules | | Investment currency restrictions, region compliance, and funding source rules |
| 模块 | 文档 | 用途 |
|---|---|---|
| 计划管理 | | 包含创建、更新、停止及追加投资的工作流和详细场景 |
| 合规与规则 | | 投资币种限制、区域合规及资金来源规则 |
Routing Rules
路由规则
| User Intent | Route to | Key Decision |
|---|---|---|
| Create plan | | Single or multi-target |
| Update plan | | Modify existing plan parameters |
| Stop plan | | Terminate automatic deductions |
| Top-up / Add position | | One-off extra purchase |
| Query plans | SKILL.md → Tool Mapping | |
| Query plan detail | SKILL.md → Tool Mapping | |
| Query supported coins | SKILL.md → Scenario 1 | |
| Query minimum amount | SKILL.md → Scenario 2 | |
| Query execution records | SKILL.md → Scenario 3 | |
| Query orders | SKILL.md → Tool Mapping | |
| Ask about restrictions | | Investment currency, region, funding |
| 用户意图 | 路由至 | 关键决策 |
|---|---|---|
| 创建计划 | | 单目标或多目标 |
| 更新计划 | | 修改现有计划参数 |
| 停止计划 | | 终止自动扣款 |
| 追加投资 | | 一次性额外购买 |
| 查询计划 | SKILL.md → 工具映射 | |
| 查询计划详情 | SKILL.md → 工具映射 | |
| 查询支持的币种 | SKILL.md → 场景1 | |
| 查询最低金额 | SKILL.md → 场景2 | |
| 查询执行记录 | SKILL.md → 场景3 | |
| 查询订单 | SKILL.md → 工具映射 | |
| 询问限制规则 | | 投资币种、区域、资金相关规则 |
Execution
执行流程
- Intent Detection: Analyze user request to determine operation type (create/update/stop/top-up/query/compliance)
- Route Selection:
- Plan lifecycle operations (create/update/stop/top-up) → Load and follow workflows
references/autoinvest-plans.md - Query operations → Use Tool Mapping table and call corresponding MCP tools directly
- Compliance questions → Load for rules and restrictions
references/autoinvest-compliance.md
- Plan lifecycle operations (create/update/stop/top-up) → Load
- Parameter Validation:
- For write operations: Validate investment currency (USDT/BTC only), amount range, execution time, and for creates per Create Plan Constraints
plan_period_day - For queries: Extract required parameters from user request
- For write operations: Validate investment currency (USDT/BTC only), amount range, execution time, and for creates
- Balance Check (for write operations):
- Call to verify sufficient funds
gate-cli cex spot account get - For Simple Earn fund source: Call if applicable
gate-cli cex earn uni lends
- Call
- Confirmation (for write operations):
- Display operation summary (Action Draft)
- Wait for explicit user confirmation
- Stop plan (): Show Action Draft and stop — do not call the tool in that same assistant turn. Call stop only after the user's next message contains explicit confirmation (
gate-cli cex earn auto-invest stop→ Scenario 9).references/autoinvest-plans.md
- MCP Tool Call:
- Execute the corresponding tool from the MCP tools section (Auto-Invest Related Tools or Supporting Tools tables) only
- Pass validated parameters
- Response Formatting:
- Use Response Template from sub-module documents
- Include key information: plan ID, amount, currency, targets, cadence
- 意图检测:分析用户请求,确定操作类型(创建/更新/停止/追加投资/查询/合规)
- 路由选择:
- 计划生命周期操作(创建/更新/停止/追加投资)→ 加载并遵循工作流
references/autoinvest-plans.md - 查询操作→ 使用工具映射表直接调用对应的MCP工具
- 合规问题→ 加载获取规则和限制
references/autoinvest-compliance.md
- 计划生命周期操作(创建/更新/停止/追加投资)→ 加载
- 参数验证:
- 写入操作:验证投资币种(仅USDT/BTC)、金额范围、执行时间,以及创建计划时的是否符合创建计划约束
plan_period_day - 查询操作:从用户请求中提取必填参数
- 写入操作:验证投资币种(仅USDT/BTC)、金额范围、执行时间,以及创建计划时的
- 余额检查(写入操作):
- 调用验证资金充足
gate-cli cex spot account get - 若资金来源为Simple Earn:必要时调用
gate-cli cex earn uni lends
- 调用
- 确认(写入操作):
- 显示操作摘要(操作草案)
- 等待用户明确确认
- 停止计划():显示操作草案并提示停止——请勿在同一助手回复中调用工具。仅在用户下一条消息包含明确确认后调用停止工具(详见
gate-cli cex earn auto-invest stop→场景9)。references/autoinvest-plans.md
- MCP工具调用:
- 仅执行MCP工具部分(自动投资相关工具或支持工具表)中的对应工具
- 传递经过验证的参数
- 响应格式化:
- 使用子模块文档中的响应模板
- 包含关键信息:计划ID、金额、币种、目标、周期
Domain Knowledge
领域知识
What is Auto-Invest (DCA)?
什么是自动投资(DCA)?
Dollar-Cost Averaging (DCA) is an investment strategy where you invest a fixed amount at regular intervals, regardless of market conditions. This approach:
- Reduces timing risk by spreading purchases over time
- Averages out entry prices across market volatility
- Removes emotional decision-making from investing
- Suitable for long-term accumulation strategies
**美元成本平均法(DCA)**是一种投资策略,无论市场状况如何,都定期投资固定金额。这种策略:
- 通过分散购买时间降低择时风险
- 在市场波动中平均买入价格
- 消除投资中的情绪化决策
- 适合长期积累策略
Auto-Invest vs Manual Trading
自动投资 vs 手动交易
| Aspect | Auto-Invest (DCA) | Manual Trading |
|---|---|---|
| Execution | Automatic, scheduled | Manual, on-demand |
| Discipline | High (no emotion) | Varies (emotion-driven) |
| Timing | Spread over time | Single point |
| Use case | Long-term accumulation | Active trading |
| Skill required | Low | High |
| 维度 | 自动投资(DCA) | 手动交易 |
|---|---|---|
| 执行方式 | 自动、定时 | 手动、按需 |
| 纪律性 | 高(无情绪化影响) | 参差不齐(受情绪驱动) |
| 时间选择 | 分散在不同时间点 | 单一时间点 |
| 适用场景 | 长期积累 | 主动交易 |
| 技能要求 | 低 | 高 |
Investment Currency
投资币种
- Investment currency: The currency deducted from your account each period (USDT or BTC only)
- Target coins: The cryptocurrencies you want to buy (can be any supported coin)
- Example: Invest 100 USDT (investment currency) → Buy BTC (target coin)
- 投资币种:每期从账户中扣除的币种(仅USDT或BTC)
- 目标币种:你想要购买的加密货币(可以是任何支持的币种)
- 示例:投资100 USDT(投资币种)→ 购买BTC(目标币种)
Cadence Options
周期选项
| Period Type | Description | Min Interval |
|---|---|---|
| Hourly | Every N hours | 1 hour |
| Daily | Every day at specified hour | 1 day |
| Weekly | Every week on specified day | 7 days |
| Biweekly | Every 2 weeks | 14 days |
| Monthly | Every month on specified day | ~30 days |
| 周期类型 | 描述 | 最小间隔 |
|---|---|---|
| 每小时 | 每N小时一次 | 1小时 |
| 每日 | 每日指定时间 | 1天 |
| 每周 | 每周指定日期 | 7天 |
| 每两周 | 每2周一次 | 14天 |
| 每月 | 每月指定日期 | ~30天 |
Fund Flow Options
资金流向选项
After creating a plan, purchased assets flow to one of two destinations:
| Option | Field Value | Destination | Chinese UI (typical) | Description | Use Case |
|---|---|---|---|---|---|
| Simple Earn | | Simple Earn | Localized app label | Assets automatically transfer to Simple Earn to earn interest | Recommended for: Passive income seekers, long-term holders who want to maximize returns |
| Spot Account | | Spot Account | Localized app label | Assets remain in Spot account for manual management (default) | Recommended for: Active traders, users who plan to withdraw or transfer assets frequently |
Important Notes:
- This setting determines where purchased coins go after each auto-invest execution (post-purchase destination)
- maps to Simple Earn;
earnmaps to spot account. API values align with localized app strings; if docs and the app disagree, follow the in-app wording.auto_invest - option provides additional passive income on accumulated assets
earn - option gives you full control to trade, withdraw, or transfer at any time
auto_invest - Default is if not specified
auto_invest
创建计划后,购买的资产将流向以下两个目的地之一:
| 选项 | 字段值 | 目的地 | 中文UI(典型) | 描述 | 适用场景 |
|---|---|---|---|---|---|
| Simple Earn | | Simple Earn | 本地化应用标签 | 资产自动转入Simple Earn赚取利息 | 推荐给:寻求被动收入的用户、希望最大化收益的长期持有者 |
| 现货账户 | | 现货账户 | 本地化应用标签 | 资产保留在现货账户供手动管理(默认) | 推荐给:活跃交易者、计划频繁提取或转移资产的用户 |
重要提示:
- 此设置决定每次自动投资执行后购买币种的去向(购买后目的地)
- **对应Simple Earn;
earn**对应现货账户。API值与本地化应用字符串一致;若文档与应用不一致,以应用内表述为准。auto_invest - 选项可为积累的资产提供额外被动收入
earn - 选项让你完全控制资产,可随时交易、提取或转移
auto_invest - 未指定时默认值为
auto_invest
Safety Rules
安全规则
Default: no write without confirmation
默认规则:无确认不执行写入操作
Until the user has given explicit confirmation for the current Action Draft, do not call any write tool (, , , ). Only read/query operations are allowed—for example: list/detail plans, supported coins, min/max config, execution records and orders, and supporting balance reads (, ).
gate-cli cex earn auto-invest creategate-cli cex earn auto-invest updategate-cli cex earn auto-invest stopgate-cli cex earn auto-invest add-positiongate-cli cex spot account getgate-cli cex earn uni lends在用户对当前操作草案给出明确确认之前,不得调用任何写入工具(、、、)。仅允许读取/查询操作——例如:列出/查看计划、支持的币种、最小/最大配置、执行记录和订单,以及支持的余额读取(、)。
gate-cli cex earn auto-invest creategate-cli cex earn auto-invest updategate-cli cex earn auto-invest stopgate-cli cex earn auto-invest add-positiongate-cli cex spot account getgate-cli cex earn uni lendsMandatory Confirmation for Write Operations
写入操作必须确认
All write operations (create, update, stop, add position) MUST follow this confirmation workflow:
- Display Action Draft: Show complete operation details before execution
- Wait for Confirmation: Explicitly ask user "Please confirm to proceed"
- Execute Only After Confirmation: Do not proceed without user's explicit agreement
Stop plan (): Show Action Draft (plan ID, name, effect: future deductions stop) and end the turn asking for confirmation. Call MCP only after the user's following message explicitly confirms — never call stop in the same assistant response as the first draft, even if the user already named a plan ID.
gate-cli cex earn auto-invest stop所有写入操作(创建、更新、停止、追加投资)必须遵循以下确认工作流:
- 显示操作草案:执行前展示完整操作细节
- 等待确认:明确询问用户“请确认是否继续”
- 仅在确认后执行:无用户明确同意不得继续
停止计划():展示操作草案(计划ID、名称、效果:未来扣款终止)并结束当前回复,等待用户确认。仅在用户下一条消息明确确认后调用MCP工具——即使用户已提供计划ID,也不得在首次展示草案的同一助手回复中调用停止工具。
gate-cli cex earn auto-invest stopStale confirmation
过期确认
If the user changes any material detail after seeing an Action Draft (amount, targets, cadence, plan ID, fund flow, , , etc.), treat earlier confirmation as void. Show an updated Action Draft and obtain a fresh explicit confirmation before any write tool call.
plan_period_hourplan_period_day如果用户在看到操作草案后更改了任何重要细节(金额、目标、周期、计划ID、资金流向、、等),则之前的确认视为无效。展示更新后的操作草案,并在调用写入工具前获取新的明确确认。
plan_period_hourplan_period_dayAdd Position Safety (Critical)
追加投资安全(关键)
⚠️ The tool is extremely sensitive:
gate-cli cex earn auto-invest add-position- Call EXACTLY ONCE per user confirmation
- NEVER call multiple times for the same request (causes duplicate deductions)
- Always confirm amount with user before calling
- Check balance before calling
Bad practice ❌:
User: "Add more to my plan"
Assistant: [Calls add_position multiple times to show different amounts]Good practice ✅:
User: "Add more to my plan"
Assistant: "How much would you like to add? Your current plan is 100 USDT per period."
User: "Add 50 USDT"
Assistant: [Shows draft] "Confirm to add 50 USDT?"
User: "Yes"
Assistant: [Calls add_position ONCE]⚠️ 工具极为敏感:
gate-cli cex earn auto-invest add-position- 每一次用户确认仅调用一次
- 切勿针对同一请求多次调用(会导致重复扣款)
- 调用前始终与用户确认金额
- 调用前检查余额
错误做法 ❌:
用户:"给我的计划追加投资"
助手:[多次调用add_position以展示不同金额]正确做法 ✅:
用户:"给我的计划追加投资"
助手:"你想要追加多少?当前计划每期投资100 USDT。"
用户:"追加50 USDT"
助手:[展示草案] "确认追加50 USDT吗?"
用户:"是的"
助手:[调用add_position一次]Parameter Validation
参数验证
Before calling any write tool:
| Validation | Rule | Action if Failed |
|---|---|---|
| Investment currency | Must be USDT or BTC | Reject and explain restriction |
| Amount | Must be within [min, max] range | Query min/max, then reject with valid range |
| Execution time | Must be integer 0-23 (on the hour) | Reject and explain hourly restriction |
| Must not be | Reject with allowed ranges; see |
| Balance | Must be sufficient for first period | Show shortfall, suggest top-up or lower amount |
调用任何写入工具前:
| 验证项 | 规则 | 验证失败操作 |
|---|---|---|
| 投资币种 | 必须是USDT或BTC | 拒绝并说明限制 |
| 金额 | 必须在[最小, 最大]范围内 | 查询最小/最大金额,然后拒绝并告知有效范围 |
| 执行时间 | 必须是0-23之间的整数(整点) | 拒绝并说明仅支持整点的限制 |
| 不能为 | 拒绝并告知允许范围;详见 |
| 余额 | 首期投资资金必须充足 | 显示资金缺口,建议充值或降低投资金额 |
No Speculation on Next Purchase Time
不得预测下一次购买时间
- Do not calculate or display the next automatic purchase time
- If user asks, direct them to Gate App or website for real-time schedule
- The system does not provide this information via API
- 不得计算或展示下一次自动购买时间
- 如果用户询问,引导其访问Gate应用或官网获取实时时间表
- 系统不通过API提供此信息
Error Handling
错误处理
| Error Condition | Detection | Response |
|---|---|---|
| Too many target coins | User specifies > 10 target coins | Reject immediately: "A plan can have at most 10 target coins. You specified {N} coins. Please reduce the number of targets." |
| Coin allocation too small | Any target coin has ratio < 10 | Reject immediately: "Each target coin must have at least 10% allocation. Coin {X} has only {Y}%. Please adjust the ratios to ensure each coin has at least 10%." |
| Insufficient balance | | Do not proceed. Inform user of shortfall: "Your current balance is {X} {currency}, but {Y} {currency} is required. Please deposit more funds or reduce the investment amount." |
| Invalid investment currency | User specifies currency other than USDT/BTC | Reject immediately: "Only USDT or BTC are supported as investment currency. Please choose USDT or BTC." |
| Amount below minimum | User amount < | Call min amount tool, then inform: "Minimum amount is {min} {currency}. Please increase your investment amount." |
| Amount above maximum | User amount > | Call config tool, then inform: "Maximum amount is {max} {currency}. Please reduce your investment amount." |
| Invalid execution time | User specifies minutes/seconds or hour outside 0-23 | Reject: "Auto-invest only supports execution on the hour (0-23). Please choose an hour between 0 and 23." |
Invalid | | Do not call create; state valid ranges: monthly 1–30; weekly/biweekly 1–7 (1 = Monday); daily/hourly/4-hourly use |
| Plan not found | Query returns no matching plan | Inform: "No matching auto-invest plan found. You can create a new plan." (See Scenario 4) |
| MCP tool missing | Required tool not available in MCP service | Explain: "Auto-invest feature requires updated MCP service. Please ensure gate-mcp is properly configured." |
| API error (401/403) | Authentication failure | Guide: "Authentication error. Please check your API key permissions include Earn (auto-invest) access." See |
| API error (4xx/5xx) | Other API errors | Report error message and suggest retry or contact support |
| Missing required parameter | Tool schema requires param with no default | Do not guess. Ask user: "Please specify {parameter_name} (e.g., {example})." |
| 错误情况 | 检测方式 | 响应 |
|---|---|---|
| 目标币种过多 | 用户指定超过10个目标币种 | 立即拒绝:"一个计划最多包含10个目标币种。你指定了{N}个币种,请减少目标币种数量。" |
| 币种分配比例过小 | 任何目标币种的比例<10 | 立即拒绝:"每个目标币种的分配比例至少为10%。币种{X}的比例仅为{Y}%,请调整比例确保每个币种至少为10%。" |
| 余额不足 | | 不继续操作。告知用户资金缺口:"你当前余额为{X} {币种},但需要{Y} {币种}。请充值更多资金或降低投资金额。" |
| 无效投资币种 | 用户指定USDT/BTC以外的币种 | 立即拒绝:"仅支持USDT或BTC作为投资币种,请选择USDT或BTC。" |
| 金额低于最低值 | 用户金额< | 调用最低金额工具,然后告知:"最低金额为{min} {币种},请提高投资金额。" |
| 金额高于最高值 | 用户金额> | 调用配置工具,然后告知:"最高金额为{max} {币种},请降低投资金额。" |
| 无效执行时间 | 用户指定了分钟/秒,或小时不在0-23之间 | 拒绝:"自动投资仅支持整点执行(0-23点),请选择0到23之间的小时数。" |
无效 | 创建时为 | 不调用创建工具;告知有效范围:每月1–30日;每周/每两周1–7日(1=周一);每日/每小时/每4小时使用 |
| 未找到计划 | 查询未返回匹配计划 | 告知:"未找到匹配的自动投资计划,你可以创建一个新计划。"(详见场景4) |
| MCP工具缺失 | MCP服务中无所需工具 | 说明:"自动投资功能需要更新的MCP服务,请确保gate-mcp已正确配置。" |
| API错误(401/403) | 身份验证失败 | 引导:"身份验证错误,请检查你的API密钥是否具备Earn(自动投资)访问权限。"详见 |
| API错误(4xx/5xx) | 其他API错误 | 报告错误信息并建议重试或联系支持人员 |
| 缺少必填参数 | 工具架构要求参数但无默认值 | 不得猜测。询问用户:"请指定{parameter_name}(例如:{example})。" |
Parameter Hygiene
参数规范
- If a tool parameter is required and the schema provides no default, prompt the user for the value
- Never guess or invent parameter values
- Always validate parameters against Business Rules before calling tools
- 如果工具参数为必填且架构未提供默认值,提示用户提供值
- 切勿猜测或编造参数值
- 始终在调用工具前根据业务规则验证参数
Judgment Logic Summary
判断逻辑总结
| Condition | Action | Tool(s) to Use |
|---|---|---|
| User wants to create plan | Route to | Validate (incl. |
| User wants to update plan | Route to | |
| User wants to stop plan | Route to | |
| User wants to top-up (add position) | Route to | |
| User wants to list plans | Direct query | |
| User wants plan detail | Direct query | |
| User asks "which coins?" | Scenario 1 | |
| User asks "minimum amount?" | Scenario 2 | |
| User asks "execution history?" | Scenario 3 | |
| User asks "order details?" | Direct query | |
| User asks about investment currency restrictions | Route to | Explain USDT/BTC only rule |
| User asks about fund source | Route to | Explain spot vs earn options |
| Plan not found in query | Scenario 4 | Inform user, offer to create new plan |
| Insufficient balance | Error Handling | Show shortfall, do not proceed |
| Invalid parameters | Error Handling | Validate against Business Rules, reject with explanation |
| 条件 | 操作 | 使用工具 |
|---|---|---|
| 用户想要创建计划 | 路由至 | 验证(含 |
| 用户想要更新计划 | 路由至 | |
| 用户想要停止计划 | 路由至 | |
| 用户想要追加投资 | 路由至 | |
| 用户想要列出计划 | 直接查询 | |
| 用户想要查看计划详情 | 直接查询 | |
| 用户询问“哪些币种?” | 场景1 | |
| 用户询问“最低金额?” | 场景2 | |
| 用户询问“执行历史?” | 场景3 | |
| 用户询问“订单详情?” | 直接查询 | |
| 用户询问投资币种限制 | 路由至 | 说明仅支持USDT/BTC的规则 |
| 用户询问资金来源 | 路由至 | 说明现货与Earn选项 |
| 查询未找到计划 | 场景4 | 告知用户,提供创建新计划的选项 |
| 余额不足 | 错误处理 | 显示资金缺口,不继续操作 |
| 参数无效 | 错误处理 | 根据业务规则验证,拒绝并说明原因 |
Report Template
报告模板
Plan Creation Success
计划创建成功
markdown
✅ Auto-invest plan created
- Invest currency: {USDT|BTC}
- Amount per period: {amount}
- Cadence: {cadence description}
- Target(s): {target coin(s) with ratios if multi-target}
- Fund source: {spot|earn}
- Fund flow: {auto_invest|earn} (spot account|Simple Earn)markdown
✅ 自动投资计划已创建
- 投资币种:{USDT|BTC}
- 每期金额:{amount}
- 周期:{周期描述}
- 目标:{目标币种(多目标时含比例)}
- 资金来源:{spot|earn}
- 资金流向:{auto_invest|earn}(现货账户|Simple Earn)Plan Update Success
计划更新成功
markdown
✅ Auto-invest plan updated
- Plan: {id or name}
- Updated: {changed fields and new values}markdown
✅ 自动投资计划已更新
- 计划:{ID或名称}
- 更新内容:{修改字段及新值}Plan Stop Success
计划停止成功
markdown
✅ Auto-invest plan stopped
- Plan: {id or name}
- Status: Automatic deductions ceased
- Note: Purchased assets remain in {account type}markdown
✅ 自动投资计划已停止
- 计划:{ID或名称}
- 状态:自动扣款已终止
- 说明:已购买资产保留在{账户类型}Top-up Success
追加投资成功
markdown
✅ Top-up executed
- Plan: {id or name}
- Amount: {amount} {invest_currency}
- Target allocation: {per Business Rules}markdown
✅ 追加投资已执行
- 计划:{ID或名称}
- 金额:{amount} {投资币种}
- 目标分配:{符合业务规则的分配方式}Query Response (Plans List)
查询响应(计划列表)
markdown
📋 Your Auto-Invest Plans
{For each plan:}
**Plan {N}: {plan_name}**
- Investment: {amount} {currency} per {cadence}
- Target(s): {coin(s)}
- Execution count: {period} times
- Status: Active
{If no plans:}
You have no active auto-invest plans. Create one to start DCA investing.markdown
📋 你的自动投资计划
{每个计划:}
**计划{N}:{计划名称}**
- 投资:{amount} {币种} 每{周期}
- 目标:{币种}
- 执行次数:{次数}
- 状态:活跃
{若无计划:}
你当前没有活跃的自动投资计划。创建一个计划开始DCA投资吧。Query Response (Supported Coins)
查询响应(支持的币种)
markdown
📋 Supported Auto-Invest Coins
{List coins returned by `gate-cli cex earn auto-invest coins`}
You can use any of these coins as targets in your auto-invest plan.markdown
📋 支持的自动投资币种
{列出`gate-cli cex earn auto-invest coins`返回的币种}
你可以选择这些币种作为自动投资计划的目标。Query Response (Minimum Amount)
查询响应(最低金额)
markdown
📋 Minimum Investment Amount
- Investment currency: {USDT|BTC}
- Target(s): {coin(s)}
- Minimum per period: {min_amount} {currency}markdown
📋 最低投资金额
- 投资币种:{USDT|BTC}
- 目标:{币种}
- 每期最低金额:{min_amount} {币种}Error Response
错误响应
markdown
❌ {Error type}
{Explanation of what went wrong}
{Actionable suggestion to resolve}markdown
❌ {错误类型}
{错误原因说明}
{可操作的解决建议}Reference Documentation
参考文档
| Document | Content |
|---|---|
| Comprehensive scenario index covering all 16 scenarios (plan lifecycle, queries, compliance) |
| Plan lifecycle operations and scenarios (create, update, stop, top-up) |
| Compliance rules and restrictions (investment currency, region, funding) |
| 文档 | 内容 |
|---|---|
| 包含所有16个场景的综合场景索引(计划生命周期、查询、合规) |
| 计划生命周期操作及场景(创建、更新、停止、追加投资) |
| 合规规则及限制(投资币种、区域、资金) |