gate-exchange-assetswap

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 Asset Allocation Optimization

Gate Exchange资产配置优化

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.
⚠️ 停止操作 — 在继续之前,您必须阅读并严格遵守共享的运行时规则。在阅读完所有规则之前,请勿选择或调用任何工具。这些规则具有最高优先级。 → 阅读gate-runtime-rules.md
  • 仅使用本Skill中明确列出的
    gate-cli
    命令
    。即使其他接口支持,也不得为这些工作流运行本文档中未记录的命令。

Skill Dependencies

Skill依赖项

gate-cli commands used

使用的gate-cli命令

Query operations (read-only, profile scope)
  • gate-cli cex assetswap assets
  • gate-cli cex assetswap config
  • gate-cli cex assetswap evaluate
  • gate-cli cex assetswap order list
  • gate-cli cex assetswap order get
Execution operations (write, trade scope)
  • gate-cli cex assetswap order preview
  • gate-cli cex assetswap order create
查询操作(只读,配置文件范围)
  • gate-cli cex assetswap assets
  • gate-cli cex assetswap config
  • gate-cli cex assetswap evaluate
  • gate-cli cex assetswap order list
  • gate-cli cex assetswap order get
执行操作(写入,交易范围)
  • gate-cli cex assetswap order preview
  • gate-cli cex assetswap order create

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: Yes
  • Permissions: Profile (read) for listing, config, evaluation, and order queries; Trade for preview and order creation
  • Portal: create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage
  • 交互式文件设置:当主机上未同时设置**
    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密钥:是
  • 权限:列出资产、查看配置、评估和查询订单需要配置文件(只读)权限;预览和创建订单需要交易权限
  • 入口:在聊天外创建或轮换密钥:https://www.gate.com/myaccount/profile/api-key/manage

Installation Check

安装检查

  • Required: Gate (main) MCP with asset allocation optimization tools enabled (MCP names
    cex_assetswap_*
    ); prefer
    gate-cli cex assetswap …
    when running from the host CLI.
  • Install (MCP / IDE):
    gate-mcp-cursor-installer
    ,
    gate-mcp-codex-installer
    ,
    gate-mcp-claude-installer
    , or
    gate-mcp-openclaw-installer
    .
  • 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 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: Before preview or order creation, confirm the runtime works (e.g.
    gate-cli --version
    or deployment-specific checks).

  • 必需:启用了资产配置优化工具的Gate(主)MCP(MCP名称为
    cex_assetswap_*
    );从主机CLI运行时,优先使用**
    gate-cli cex assetswap …
    **命令。
  • 安装(MCP / IDE):使用
    gate-mcp-cursor-installer
    gate-mcp-codex-installer
    gate-mcp-claude-installer
    gate-mcp-openclaw-installer
  • 凭证:当主机上的**
    GATE_API_KEY
    GATE_API_SECRET
    均已设置(非空)时,无需要求运行
    gate-cli config init
    。当两者均未设置或为空时,提醒操作人员运行
    gate-cli config init
    ** 从Skill库中配置匹配Skill的**
    GATE_API_KEY
    ** /
    GATE_API_SECRET
    (切勿要求用户在聊天中粘贴密钥)。
  • 完整性检查:在预览或创建订单之前,确认运行时正常工作(例如执行**
    gate-cli --version
    **或特定部署的检查)。

Trigger Conditions

触发条件

Activate this skill when the user wants any of the following:
  • Multi-asset spot portfolio optimization or rebalancing into a strategy (conservative stablecoin, conviction single asset, or market-cap-weighted basket)
  • To see which spot balances are eligible for asset allocation optimization
  • Preview estimated execution, slippage, or risk hints before committing
  • Submit an asset allocation optimization order after confirmation
  • Query historical allocation optimization orders or one order’s status and child orders
Do not use this skill for: transfers between accounts or products, Launchpool or earn subscriptions, single manual spot limit/market orders without the allocation product, or dust handling below product thresholds (route to the appropriate transfer, earn, spot, or small-balance product skill instead).

当用户需要以下任一操作时,激活此Skill:
  • 将多资产现货投资组合优化重新平衡为特定策略(保守型稳定币、单一核心资产、市值加权篮子)
  • 查看哪些现货余额符合资产配置优化的条件
  • 在确认前预览预估执行情况、滑点或风险提示
  • 确认后提交资产配置优化订单
  • 查询历史资产配置优化订单或单个订单的状态及子订单
请勿将此Skill用于:账户或产品间转账、Launchpool或理财订阅、无配置产品的单个手动现货限价/市价订单,或低于产品阈值的小额资产处理(转而使用对应的转账、理财、现货或小额资产处理Skill)。

Data privacy and collection

数据隐私与收集

  • AI interaction information: User prompts, follow-up instructions, and tool arguments used while following this skill qualify as AI interaction data under the Gate Privacy Policy (see §4.2.7). Do not ask for or repeat API keys, secrets, or unrelated personal data in user-visible output.
  • Data flow: Account and trading data for this skill flow only through the configured Gate (main) MCP to Gate Exchange APIs via the asset-swap tools above (MCP
    cex_assetswap_*
    or equivalent
    gate-cli cex assetswap …
    calls). Do not relay the same data to undocumented third-party services, scrapers, or custom backends as part of this workflow.
  • Minimization: Pass only parameters required by each documented MCP call (symbols, amounts, strategy fields, pagination). Do not send full chat transcripts or unrelated context fields into tool payloads.

  • AI交互信息:遵循本Skill时使用的用户提示、后续指令和工具参数属于Gate隐私政策(见第4.2.7节)定义的AI交互数据。请勿在用户可见的输出中询问或重复API密钥、密钥或无关的个人数据。
  • 数据流:本Skill的账户和交易数据仅通过配置的Gate(主)MCP,经由上述资产交换工具(MCP
    cex_assetswap_*
    或等效的
    gate-cli cex assetswap …
    调用)流向Gate Exchange APIs。作为本工作流的一部分,请勿将相同数据转发给未记录的第三方服务、爬虫或自定义后端。
  • 最小化原则:仅传递每个已记录MCP调用所需的参数(交易对、金额、策略字段、分页参数)。请勿将完整聊天记录或无关上下文字段发送到工具负载中。

Domain Knowledge

领域知识

Product: Asset Allocation Optimization exposes Exchange capability for restructuring multiple spot holdings into a target mix. One optimization may map to multiple internal execution legs at the order layer.
Strategy types (conceptual; exact enums and parameters come from
gate-cli cex assetswap config
):
StrategyTypical targetsMeaning
ConservativeUSDT, GUSD, USDC (examples)Consolidate into a single stablecoin; risk-off / idle cash posture
Conviction ("faith")BTC, ETH, GT (examples)Reallocate selected spot toward target weights in the chosen asset(s); intermediate steps follow the product and API
Market capTop 2, Top 5 (examples)Index-like exposure weighted by market cap into a basket such as BTC, ETH, SOL, BNB, XRP (actual list from API)
Listing rules (for agent interpretation; product may filter server-side):
  • Default presentation may exclude major reserve assets (e.g. BTC, ETH, USDT, USDC) unless the user explicitly asks to include them in the sell set.
  • Only spot available balances participate; locked balances from earn, borrow, staking, or similar are out of scope.
  • Very small balances (e.g. below roughly USD 10 equivalent) may be hidden or routed to small-balance handling; exact thresholds follow API or product rules.
Out of scope for public skill documentation (do not document as standard Exchange MCP capabilities):
  • Banner or UI-only feature flags
  • Non-standard semantic "validate and fill parameters" helpers not published as Exchange MCP
Rate limiting: Align with wallet or Exchange API limits when documented (example: 200 requests per 10 seconds per user or key); confirm in published API docs.
Preview → create payload (mandatory for agents):
  • After a successful
    gate-cli cex assetswap order preview
    , construct the
    gate-cli cex assetswap order create
    body from the preview response
    data.order
    only: for each object in
    data.order.from
    and
    data.order.to
    , emit
    { "asset": <value>, "amount": <value> }
    using the preview’s
    asset
    and
    amount
    string fields (use
    amount
    , not
    amount_show
    , unless published API docs say otherwise).
  • Preserve the array order of
    to
    (and
    from
    if multiple legs) exactly as returned in
    data.order
    ; do not reorder symbols for convenience.
  • A preview request may use
    ratio
    on
    to
    ; the create call must still use the resolved
    asset
    +
    amount
    legs from the preview output. Creating with ratio-only
    to
    while omitting preview amounts often yields quote errors (for example
    code: 4
    ).
  • If the API returns additional preview-bound fields (for example top-level
    usdt_evaluated_value
    or
    transaction_fee
    inside
    data
    ), mirror them on create when the MCP or Exchange docs require it; otherwise the
    from
    /
    to
    legs from preview are the primary contract.
Main chain (mandatory order for placement):
  1. Case 1 — list eligible assets
  2. Case 2 — get strategy and parameter configuration
  3. Case 3 — pre-trade evaluation and preview (3a optional, 3b strongly required or mandatory per product rules)
  4. Case 4 — create order after explicit user confirmation of preview
Do not jump from Case 2 to Case 4 without Case 3b preview unless product rules explicitly allow it.
Supplemental queries (do not reorder the main chain):
  • Case 5 — paginated order list
  • Case 6 — single order detail
Order states (examples): configuring, completed, partially completed, failed — use API field names and values from responses.
Tool scope summary:
ToolTypeScope
gate-cli cex assetswap assets
Readprofile
gate-cli cex assetswap config
Readprofile
gate-cli cex assetswap evaluate
Readprofile
gate-cli cex assetswap order list
Readprofile
gate-cli cex assetswap order get
Readprofile
gate-cli cex assetswap order preview
Writetrade
gate-cli cex assetswap order create
Writetrade
Compliance: Restricted regions, KYC, and disabled accounts are enforced by the API. On compliance errors, relay the message and stop; do not promise outcomes the platform does not guarantee.
Agent must not: guarantee PnL, VIP tier level changes, or bypass eligibility rules.

产品:资产配置优化是交易所提供的一项功能,可将多个现货持仓重组为目标组合。一次优化可能对应订单层的多个内部执行环节。
策略类型(概念性;具体枚举和参数来自
gate-cli cex assetswap config
):
策略类型典型目标含义
保守型USDT、GUSD、USDC(示例)合并为单一稳定币;低风险/闲置资金配置
核心资产型("信念型")BTC、ETH、GT(示例)将选定现货重新分配至所选资产的目标权重;中间步骤遵循产品和API规则
市值加权型前2、前5(示例)按市值加权获得指数化敞口,投资于BTC、ETH、SOL、BNB、XRP等篮子资产(实际列表来自API)
列出规则(供Agent解读;产品可能在服务器端过滤):
  • 默认展示可能排除主要储备资产(如BTC、ETH、USDT、USDC),除非用户明确要求将其纳入卖出资产集合。
  • 现货可用余额参与;来自理财、借贷、质押或类似业务的锁定余额不在范围内。
  • 极小余额(例如约10美元等值以下)可能被隐藏或转至小额资产处理;具体阈值遵循API或产品规则。
公共Skill文档不包含的内容(请勿记录为标准Exchange MCP功能):
  • 横幅或仅UI可见的功能标志
  • 未作为Exchange MCP发布的非标准语义“验证并填充参数”助手
速率限制:遵循钱包或Exchange API文档中记录的限制(例如每个用户或密钥每10秒200次请求);请在已发布的API文档中确认。
预览→创建负载(Agent必需)
  • 成功执行
    gate-cli cex assetswap order preview
    后,仅从预览响应的**
    data.order
    构建
    gate-cli cex assetswap order create
    的请求体:对于
    data.order.from
    data.order.to
    中的每个对象,使用预览的
    asset
    amount
    字符串字段生成
    { "asset": <value>, "amount": <value> }
    (除非已发布的API文档另有说明,否则使用
    amount
    而非
    amount_show
    **)。
  • 严格保留
    to
    (以及多个环节的
    from
    )在
    data.order
    中返回的数组顺序;请勿为了方便重新排序交易对。
  • 预览请求可能在
    to
    上使用**
    ratio
    **;创建调用仍必须使用预览输出中已解析的
    asset
    +
    amount
    环节。仅使用
    ratio
    to
    而省略预览金额创建订单通常会导致报价错误(例如
    code: 4
    )。
  • 如果API返回额外的预览绑定字段(例如顶层的
    usdt_evaluated_value
    data
    内的
    transaction_fee
    ),仅当MCP或Exchange文档要求时才在创建时镜像这些字段;否则预览中的
    from
    /
    to
    环节是主要依据。
主流程(下单必需顺序)
  1. 场景1 — 列出合格资产
  2. 场景2 — 获取策略和参数配置
  3. 场景3 — 交易前评估和预览(3a可选,3b根据产品规则强烈要求或必需)
  4. 场景4 — 用户明确确认预览后创建订单
除非产品规则明确允许,否则请勿跳过场景3b预览,直接从场景2跳到场景4。
补充查询(请勿打乱主流程顺序):
  • 场景5 — 分页订单列表
  • 场景6 — 单个订单详情
订单状态(示例):配置中、已完成、部分完成、失败 — 使用响应中的API字段名称和值。
工具范围总结
工具类型范围
gate-cli cex assetswap assets
只读配置文件
gate-cli cex assetswap config
只读配置文件
gate-cli cex assetswap evaluate
只读配置文件
gate-cli cex assetswap order list
只读配置文件
gate-cli cex assetswap order get
只读配置文件
gate-cli cex assetswap order preview
写入交易
gate-cli cex assetswap order create
写入交易
合规性:API会强制执行受限地区、KYC和禁用账户规则。遇到合规错误时,转发错误信息并停止操作;请勿承诺平台无法保证的结果。
Agent不得:保证盈亏、VIP等级变化或绕过资格规则。

Workflow

工作流

Step 1: Resolve user goal and route requests outside asset allocation optimization

步骤1:明确用户目标并路由资产配置优化之外的请求

Classify the request as: (A) discovery only, (B) full optimization through preview and optional order, (C) history or single-order status.
From the user message and session context only, infer intent and routing. Do not call any
cex_*
MCP tool in this step. If the user wants a single conventional spot order, transfer, grid bot, or earn action, stop using this skill and route to the appropriate Gate Exchange skill.
Key data to extract:
  • goal
    :
    list_only
    |
    evaluate_only
    |
    preview
    |
    place_order
    |
    order_list
    |
    order_detail
  • strategy_hint
    : conservative | conviction | market_cap | unknown (confirm via config)
  • symbols_or_scope
    : which assets the user wants to include or exclude
将请求分类为:(A) 仅发现,(B) 完整优化(含预览和可选下单),(C) 历史记录或单个订单状态。
仅从用户消息和会话上下文推断意图并路由。在此步骤中,请勿调用任何
cex_*
MCP工具。如果用户需要单个常规现货订单、转账网格交易机器人理财操作,停止使用此Skill并转至对应的Gate Exchange Skill。
需要提取的关键数据:
  • goal
    :
    list_only
    |
    evaluate_only
    |
    preview
    |
    place_order
    |
    order_list
    |
    order_detail
  • strategy_hint
    : conservative | conviction | market_cap | unknown(通过配置确认)
  • symbols_or_scope
    : 用户希望包含或排除的资产

Step 2: Case 1 — List assets eligible for optimization

步骤2:场景1 — 列出符合优化条件的资产

Call
gate-cli cex assetswap assets
with: parameters per MCP and API documentation (no undocumented fields).
Key data to extract:
  • eligible_assets
    : symbols, available amounts, valuation hints returned by the API
  • Whether the user must narrow the set for the next steps
调用
gate-cli cex assetswap assets
:参数遵循MCP和API文档(无未记录字段)。
需要提取的关键数据:
  • eligible_assets
    : API返回的交易对、可用金额、估值提示
  • 用户是否需要缩小资产集合以进行下一步操作

Step 3: Case 2 — Load configuration

步骤3:场景2 — 加载配置

Call
gate-cli cex assetswap config
with: no required body unless the API specifies optional filters; obtain allowed strategies, targets, limits, and precision rules.
Key data to extract:
  • allowed_strategies
    and parameter shapes for TopN, target asset, and limits
  • Constraints the agent must enforce when building the next request payload
调用
gate-cli cex assetswap config
:除非API指定可选过滤器,否则无需请求体;获取允许的策略、目标、限制和精度规则。
需要提取的关键数据:
  • allowed_strategies
    以及TopN、目标资产和限制的参数格式
  • Agent构建下一个请求负载时必须遵守的约束

Step 4: Case 3a — Evaluation (optional)

步骤4:场景3a — 评估(可选)

When the user needs a quick estimate before final parameters, or while iterating on strategy choice:
Call
gate-cli cex assetswap evaluate
with: payload required by the API for the selected assets and strategy.
Key data to extract:
  • evaluation_summary
    : estimated notionals or other returned metrics
  • Any warnings or validation errors
当用户需要在确定最终参数前快速估算,或在迭代策略选择时:
调用
gate-cli cex assetswap evaluate
:负载符合API对所选资产和策略的要求。
需要提取的关键数据:
  • evaluation_summary
    : 预估金额或其他返回指标
  • 任何警告或验证错误

Step 5: Case 3b — Preview order (required before create in normal flow)

步骤5:场景3b — 预览订单(正常流程中创建前必需)

After the user confirms the asset set and strategy parameters:
Call
gate-cli cex assetswap order preview
with: candidate selection and strategy fields per API docs.
Present preview outputs clearly: estimated fills, slippage or risk hints, and any server-side notices. Obtain explicit user confirmation after preview before Step 6.
If the market moves or the preview expires, repeat Step 5 (and Step 4 if needed) before creating an order.
Key data to extract:
  • preview_reference_fields
    : any quote, token, or expiry fields required for Step 6 (follow response schema exactly)
  • create_from_legs
    : copy of
    data.order.from
    reduced to
    { asset, amount }
    per element (from preview
    amount
    , not
    amount_show
    )
  • create_to_legs
    : copy of
    data.order.to
    reduced to
    { asset, amount }
    per element, same order as preview
  • user_confirmed
    : boolean — must be true to proceed
用户确认资产集合和策略参数后:
调用
gate-cli cex assetswap order preview
:候选选择和策略字段遵循API文档。
清晰展示预览输出:预估成交情况、滑点或风险提示,以及任何服务器端通知。在步骤6之前,获取用户的明确确认
如果市场波动或预览过期,在创建订单前重复步骤5(必要时重复步骤4)。
需要提取的关键数据:
  • preview_reference_fields
    : 步骤6所需的任何报价、代币或过期字段(严格遵循响应 schema)
  • create_from_legs
    : 从
    data.order.from
    复制并简化为每个元素
    { asset, amount }
    (来自预览的**
    amount
    **,而非
    amount_show
  • create_to_legs
    : 从
    data.order.to
    复制并简化为每个元素
    { asset, amount }
    顺序与预览完全一致
  • user_confirmed
    : 布尔值 — 必须为true才能继续

Step 6: Case 4 — Create optimization order

步骤6:场景4 — 创建优化订单

Only after successful preview and explicit confirmation:
Call
gate-cli cex assetswap order create
with: JSON body whose
from
is
create_from_legs
and
to
is
create_to_legs
from Step 5 (each leg
asset
+
amount
from
data.order
). Add any other preview-bound fields required by the API (for example values under
data
such as
usdt_evaluated_value
or
transaction_fee
) only when documentation or repeated failures indicate they are required. Do not substitute ratio-only
to
for this step when the preview already returned concrete
amount
per target asset.
Key data to extract:
  • order_id
    or equivalent identifier
  • Initial status and timestamps
  • Next-step guidance (poll detail or show history)
仅在预览成功且用户明确确认后:
调用
gate-cli cex assetswap order create
:JSON请求体的**
from
为步骤5中的
create_from_legs
to
为步骤5中的
create_to_legs
(每个环节为
data.order
中的
asset
+
amount
**)。仅当文档或多次失败表明需要时,才添加API要求的其他预览绑定字段(例如
data
下的
usdt_evaluated_value
transaction_fee
等值)。如果预览已返回每个目标资产的具体
amount
,请勿在此步骤中仅使用
ratio
to
需要提取的关键数据:
  • order_id
    或等效标识符
  • 初始状态和时间戳
  • 下一步指导(轮询详情或查看历史)

Step 7: Case 5 — List orders (supplemental)

步骤7:场景5 — 订单列表(补充)

When the user asks for recent history:
Call
gate-cli cex assetswap order list
with: pagination parameters per API (for example recent months as defined by product).
Key data to extract:
  • orders[]
    : identifiers, statuses, created times
  • Pagination cursors or flags if present
当用户请求近期历史记录时:
调用
gate-cli cex assetswap order list
:分页参数遵循API(例如产品定义的最近几个月)。
需要提取的关键数据:
  • orders[]
    : 标识符、状态、创建时间
  • 分页游标或标志(如果存在)

Step 8: Case 6 — Order detail (supplemental)

步骤8:场景6 — 订单详情(补充)

When the user supplies an order id or picks one from a list:
Call
gate-cli cex assetswap order get
with:
order_id
string per MCP and API documentation.
Key data to extract:
  • Aggregate status and per-child order states if returned
  • Amounts consumed and received as returned by the API

当用户提供订单ID或从列表中选择一个订单时:
调用
gate-cli cex assetswap order get
order_id
字符串遵循MCP和API文档。
需要提取的关键数据:
  • 聚合状态和子订单状态(如果返回)
  • API返回的已消耗和已接收金额

Error Handling

错误处理

SituationAction
Preview expired or price invalidRe-run
gate-cli cex assetswap order preview
(and evaluation if needed); explain briefly
Create returns quote error after successful previewConfirm create body uses
asset
+
amount
from
data.order.from
/
data.order.to
(preview order preserved); re-preview and retry; avoid ratio-only
to
if preview returned amounts
Insufficient available balanceStop create; ask user to free balance or adjust selection
Rate limitBack off and retry later; show the API message
Compliance or region blockStop; relay compliance message; do not retry with workarounds
Partial completionReport actual status from
gate-cli cex assetswap order get
; no guaranteed completion time

场景操作
预览过期或价格无效重新运行
gate-cli cex assetswap order preview
(必要时重新评估);简要说明原因
预览成功但创建订单返回报价错误确认创建请求体使用
data.order.from
/
data.order.to
中的**
asset
+
amount
**(保留预览订单);重新预览并重试;如果预览返回金额,避免仅使用
ratio
to
可用余额不足停止创建订单;请用户释放余额或调整资产选择
速率限制延迟后重试;显示API返回的消息
合规或地区限制停止操作;转发合规消息;请勿尝试变通方法重试
部分完成
gate-cli cex assetswap order get
报告实际状态;无法保证完成时间

Safety Rules

安全规则

  • Trading risk: Digital asset trading involves significant risk and may result in partial or total loss of your investment. See the Gate Risk Disclosure and User Agreement.
  • Never call
    gate-cli cex assetswap order create
    without a successful preview and clear user confirmation of preview contents, except where the user’s own explicit one-shot authorization is defined by runtime rules for this product (default: require confirmation).
  • Never build the create payload with ratio-only target legs when the preview response already includes
    data.order.to
    entries with
    amount
    ; use those
    asset
    +
    amount
    pairs (and matching
    from
    legs) for create.
  • Never fabricate order IDs, preview tokens, or success when the API returned an error.
  • Display rates and amounts as estimates until execution; final settlement is authoritative.
  • Do not expose API keys or secrets in user-visible output.

  • 交易风险:数字资产交易存在重大风险,可能导致部分或全部投资损失。请参阅Gate风险披露用户协议
  • 除非产品运行时规则定义了用户自身明确的一次性授权(默认:需要确认),否则在未成功预览且用户未明确确认预览内容的情况下,切勿调用
    gate-cli cex assetswap order create
  • 如果预览响应已包含**
    data.order.to
    条目及
    amount
    ,切勿仅使用
    ratio
    的目标环节构建创建请求负载;请使用这些
    asset
    +
    amount
    **对(以及匹配的
    from
    环节)。
  • API返回错误时,切勿伪造订单ID、预览令牌或成功信息。
  • 在执行前,将汇率和金额显示为预估数值;最终结算结果为准。
  • 请勿在用户可见的输出中暴露API密钥或密钥。

Judgment Logic Summary

判断逻辑总结

ConditionAction
User wants eligible spot assets for portfolio optimizationCase 1 only (
gate-cli cex assetswap assets
)
User needs strategy options or limitsCase 2 (
gate-cli cex assetswap config
)
User wants a quick estimateCase 3a (
gate-cli cex assetswap evaluate
)
User is ready to see executable previewCase 3b (
gate-cli cex assetswap order preview
)
User confirmed previewCase 4 (
gate-cli cex assetswap order create
)
User asks for past optimizationsCase 5 (
gate-cli cex assetswap order list
)
User asks for one order’s progressCase 6 (
gate-cli cex assetswap order get
)
User wants single spot order or grid botRoute out of this skill
Preview failed or expiredRe-preview; do not create

条件操作
用户希望获取符合投资组合优化条件的现货资产仅执行场景1(
gate-cli cex assetswap assets
用户需要策略选项或限制执行场景2(
gate-cli cex assetswap config
用户需要快速估算执行场景3a(
gate-cli cex assetswap evaluate
用户准备查看可执行的预览执行场景3b(
gate-cli cex assetswap order preview
用户确认预览执行场景4(
gate-cli cex assetswap order create
用户查询历史优化记录执行场景5(
gate-cli cex assetswap order list
用户查询单个订单进度执行场景6(
gate-cli cex assetswap order get
用户需要单个现货订单或网格交易机器人转至其他Skill
预览失败或过期重新预览;请勿创建订单

Report Template

报告模板

markdown
undefined
markdown
undefined

Asset allocation optimization

资产配置优化

Goal: {list | evaluate | preview | order placed | history | detail}
Eligible assets (summary): {N} items, {optional total valuation if API provides}
Strategy: {conservative | conviction | market_cap | from API}
Preview (if run):
  • Key figures: {from API}
  • Create legs (if placing order): {
    from
    /
    to
    as
    asset
    +
    amount
    from
    data.order
    }
  • Risk or slippage notes: {from API}
Order (if created):
  • Order ID: {id}
  • Status: {status}
History / detail (if queried):
  • {table or bullet list from API}
Disclaimer: Digital asset trading involves significant risk and may result in partial or total loss of your investment. Figures are from Gate Exchange APIs; final balances and fees follow account records. No PnL or VIP impact is guaranteed.
undefined
目标: {list | evaluate | preview | order placed | history | detail}
合格资产(摘要): {N}项,{API提供的话可选总估值}
策略: {conservative | conviction | market_cap | 来自API}
预览(若已执行):
  • 关键数据: {来自API}
  • 创建环节(若下单): {
    from
    /
    to
    data.order
    中的
    asset
    +
    amount
    }
  • 风险或滑点提示: {来自API}
订单(若已创建):
  • 订单ID: {id}
  • 状态: {status}
历史/详情(若已查询):
  • {来自API的表格或项目符号列表}
免责声明: 数字资产交易存在重大风险,可能导致部分或全部投资损失。数据来自Gate Exchange APIs;最终余额和费用以账户记录为准。不保证盈亏或VIP等级变化。
undefined