Gate Exchange Assets Assistant
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 ./references/gate-runtime-rules.md
- - Only call MCP tools explicitly listed in this skill. Tools not documented here must NOT be called, even if they
exist in the MCP server.
MCP Dependencies
Required MCP Servers
| MCP Server | Status |
|---|
| Gate (main) | ✅ Required |
MCP Tools Used
Query Operations (Read-only)
- - cexdclistdcaccounts
- cexearnlistdualbalance
- cexearnlistdualorders
- cexearnliststructuredorders
- cexfxgetfxaccounts
- cexmarginlistmarginaccounts
- cexoptionslistoptionsaccount
- cexspotgetspotaccounts
- cexspotlistspotaccountbook
- cextradfiqueryuserassets
- cexunifiedgetunifiedaccounts
- cexwalletgettotal_balance
Authentication
- - Credentials Source: Local Gate MCP deployment (
GATE_API_KEY, GATE_API_SECRET) - API Key Required: Yes
- Permissions: Delivery:Read, Earn:Read, Fx:Read, Margin:Read, Options:Read, Spot:Read, Tradfi:Read, Unified:Read, Wallet:Read
- Never ask the user to paste secrets into chat; rely on the configured MCP session only.
- API Key Provisioning Reference: https://www.gate.com/myaccount/profile/api-key/manage (create or rotate keys outside the chat when the local MCP setup requires them).
Installation Check
- - Required: Gate (main)
- Install: Use the local Gate MCP installation flow for the current host IDE before continuing.
- Continue only after the Gate MCP session is configured with the credentials listed above; do not switch to browser auth or ask the user to paste secrets into chat.
MCP Mode
Read and strictly follow references/mcp.md, then execute this skill's assets-query workflow.
- -
SKILL.md keeps intent routing and rendering rules. - INLINECODE5 is the authoritative MCP execution layer for multi-account data collection, normalization, and degraded output handling.
Domain Knowledge
MCP Tool Mapping (Gate gate-mcp)
| MCP Tool | Purpose | Key Fields |
|---|
| INLINECODE6 | Total balance (all sub-accounts, ~1min cache) | total.amount, details (spot/futures/delivery/finance/quant/memebox/options/payment/margin/crossmargin) |
| INLINECODE7 |
Spot balance (filter by currency) | currency, available, locked |
|
cex_unified_get_unified_accounts | Unified account (single/cross/portfolio margin) | balances, unified
accounttotal, margin_mode |
|
cex_fx_get_fx_accounts | Perpetual (settle=usdt or btc) | total, unrealised_pnl, available, point, bonus |
|
cex_dc_list_dc_accounts | Delivery (settle=usdt) | total, unrealised_pnl, available |
|
cex_options_list_options_account | Options | total
value, unrealisedpnl, available |
|
cex_margin_list_margin_accounts | Isolated margin | currency_pair, mmr, base/quote (available/locked/borrowed/interest) |
|
cex_tradfi_query_user_assets | TradFi assets | USDx balance, margin |
|
cex_earn_list_dual_balance,
cex_earn_list_dual_orders,
cex_earn_list_structured_orders | Finance | Flexible savings / Dual currency / Structured |
|
cex_spot_list_spot_account_book | Spot account book / ledger | ledger entries |
Account Name Mapping (details key → Display)
| API key | Display |
|---|
| spot | Spot account / Trading account |
| futures |
Futures account (USDT perpetual) |
| delivery | Delivery contract account |
| options | Options account |
| finance | Finance account |
| quant | Quant/bot account |
| meme_box | Alpha account |
| margin | Isolated margin account |
| cross_margin | Cross margin account |
| payment | Payment account (not in total) |
Key Rules
- - Read-only. No trading, transfer, or order placement.
- TradFi / payment: USDx and payment assets are NOT included in CEX total; display separately.
- Unified account: When marginmode is classic/crossmargin/portfolio, spot may be merged into "trading account". Do NOT use internal terms like "advanced mode", "S1/S2".
- Pair format: Futures use no-slash (BTCUSDT); spot/margin use slash (BTC/USDT).
- Precision: Fiat valuation 2 decimals; dust (<$0.01) show as
<$0.01; finance yesterday PnL up to 8 decimals.
Case Routing Map
I. Total & Overview (Case 1)
| Case | Trigger Phrases | MCP Tool | Output |
|---|
| 1 | "How much do I have", "Show my CEX total assets", "Account asset distribution", "Account overview", "Check my balance" | INLINECODE19 currency=USDT | Total amount, account distribution, coin distribution; TradFi/payment listed separately if any |
II. Specific Currency (Case 2)
| Case | Trigger Phrases | MCP Tool | Output |
|---|
| 2 | "How many BTC do I have", "How many USDT do I have" | Concurrent: cex_spot_get_spot_accounts, cex_unified_get_unified_accounts, cex_fx_get_fx_accounts, cex_dc_list_dc_accounts, cex_margin_list_margin_accounts, cex_earn_list_dual_balance, etc. | Total {COIN} held, distribution by account |
III. Specific Account + Currency (Case 3)
| Case | Trigger Phrases | MCP Tool | Output |
|---|
| 3 | "How much USDT in my spot account", "How much BTC in my spot account" | INLINECODE26 currency={COIN} or cex_unified_get_unified_accounts currency={COIN} | Account name, total, available, locked |
IV. Sub-Account Queries (Case 4–15)
| Case | Account | Trigger Phrases | MCP Tool |
|---|
| 4 | Spot | "What's in my spot account", "Show my spot account assets" | INLINECODE28 or INLINECODE29 |
| 5 |
Futures | "How much in futures account", "USDT perpetual", "BTC perpetual", "Delivery" |
cex_fx_get_fx_accounts settle=usdt/btc,
cex_dc_list_dc_accounts |
| 6 | Trading (Unified) | "How much in trading account", "How much in unified account" |
cex_unified_get_unified_accounts |
| 7 | Options | "How much in options account", "Show my options assets" |
cex_options_list_options_account or
cex_unified_get_unified_accounts |
| 8 | Finance | "How much in finance account", "Show my finance account assets" |
cex_earn_list_dual_balance,
cex_earn_list_dual_orders,
cex_earn_list_structured_orders |
| 9 | Alpha | "How much in Alpha account", "Show my Alpha assets" |
cex_wallet_get_total_balance details.meme_box |
| 12 | Isolated Margin | "How much in isolated margin account", "Show my isolated margin assets" |
cex_margin_list_margin_accounts |
| 15 | TradFi | "How much in TradFi account", "Show my TradFi assets" |
cex_tradfi_query_user_assets |
V. Account Book (Legacy 5–7)
| Case | Intent | MCP Tool |
|---|
| 5 | Account book for coin | INLINECODE41 |
| 6 |
Ledger + current balance |
cex_spot_list_spot_account_book →
cex_spot_get_spot_accounts |
| 7 | Recent activity |
cex_spot_list_spot_account_book |
Special Scenario Handling
| Scenario | Handling |
|---|
| Total < 10 USDT | Show small-asset tip; recommend [Deposit] or [Dust conversion] |
| Unified account migration |
"Your account is upgrading to unified account, asset data may be incomplete, please retry in ~5 minutes" |
| Dust (>10 dust coins) | "~${total_val} dust across {N} currencies" → [Dust conversion] |
| API timeout/error | "Data fetch error, please retry later" → [Refresh] |
| Account/coin balance = 0 | Do NOT show "your xx account is 0"; skip that item |
| USDT + TradFi | Show TradFi (USDx) separately; "TradFi in USDx, 1:1 with USDT, not in CEX total" |
| GTETH / voucher tokens | Explain: On-chain earn voucher, cannot withdraw to chain |
| ST token | Risk warning, suggest checking official announcements |
| Delisted token | Explain delisting, suggest withdrawal |
| Unified account, user asks "spot" | Inform spot merged into trading account; show trading account balance |
Output Templates
Case 1 – Total Balance:
CODEBLOCK0
Case 2 – Specific Currency:
CODEBLOCK1
Case 15 – TradFi:
CODEBLOCK2
Acceptance Test Queries (Validation)
| Scenario | Query |
|---|
| Total balance – normal | How much do I have? |
| Total balance – overview |
Show my CEX total assets |
| Total balance – small (<10U) | My account asset distribution |
| Specific currency – normal | How many BTC do I have? |
| Specific currency – zero | How much DOGE do I have? |
| Specific account+currency | How much USDT in my spot account? |
| Spot account | What's in my spot account? |
| Futures – with assets | How much in futures account |
| Futures – USDT+BTC perpetual | Show my perpetual contract assets |
| Futures – no assets | Show my USDT perpetual assets |
| Trading account | How much in trading account |
| Options | Show my options assets |
| Alpha | How much in Alpha account |
| Isolated margin | Show my isolated margin assets |
| TradFi | How much in TradFi account |
Cross-Skill Workflows
- - Before trading: User asks "Can I buy 100U BTC?" → This skill:
cex_spot_get_spot_accounts currency=USDT → Route to gate-exchange-spot if sufficient. - After transfer: Route to this skill for updated balance when user asks.
- Transfer card: When futures/options = 0, recommend [Transfer] and trigger transfer skill.
Safety Rules
- - Read-only only. Never call createorder, cancelorder, create_transfer, or any write operation.
- If user intent includes trading, transfer, or order placement → route to appropriate skill.
- Always clarify currency and scope (spot vs all wallets) when ambiguous.
For detailed scenario templates and edge cases, see references/scenarios.md.
Gate交易所资产助手
通用规则
⚠️ 停止——在继续之前,您必须阅读并严格遵守共享运行时规则。
在阅读所有规则之前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读 ./references/gate-runtime-rules.md
- - 仅调用本技能中明确列出的MCP工具。 即使MCP服务器中存在未在此处记录的工具,也禁止调用。
MCP依赖
必需的MCP服务器
使用的MCP工具
查询操作(只读)
- - cexdclistdcaccounts
- cexearnlistdualbalance
- cexearnlistdualorders
- cexearnliststructuredorders
- cexfxgetfxaccounts
- cexmarginlistmarginaccounts
- cexoptionslistoptionsaccount
- cexspotgetspotaccounts
- cexspotlistspotaccountbook
- cextradfiqueryuserassets
- cexunifiedgetunifiedaccounts
- cexwalletgettotal_balance
身份验证
- - 凭证来源:本地Gate MCP部署(GATEAPIKEY,GATEAPISECRET)
- 需要API密钥:是
- 权限:交割:读取,理财:读取,外汇:读取,杠杆:读取,期权:读取,现货:读取,TradFi:读取,统一账户:读取,钱包:读取
- 切勿要求用户将密钥粘贴到聊天中;仅依赖已配置的MCP会话。
- API密钥配置参考:https://www.gate.com/myaccount/profile/api-key/manage(当本地MCP设置需要时,在聊天之外创建或轮换密钥)。
安装检查
- - 必需:Gate (主)
- 安装:在继续之前,使用当前主机IDE的本地Gate MCP安装流程。
- 仅在Gate MCP会话配置了上述凭证后继续;请勿切换到浏览器认证或要求用户将密钥粘贴到聊天中。
MCP模式
阅读并严格遵守 references/mcp.md,然后执行本技能的资产查询工作流。
- - SKILL.md 负责意图路由和渲染规则。
- references/mcp.md 是用于多账户数据收集、标准化和降级输出处理的权威MCP执行层。
领域知识
MCP工具映射(Gate gate-mcp)
| MCP工具 | 用途 | 关键字段 |
|---|
| cexwalletgettotalbalance | 总余额(所有子账户,约1分钟缓存) | total.amount, details (spot/futures/delivery/finance/quant/memebox/options/payment/margin/crossmargin) |
| cexspotgetspotaccounts |
现货余额(按币种筛选) | currency, available, locked |
| cex
unifiedget
unifiedaccounts | 统一账户(单一/全仓/投资组合保证金) | balances, unified
accounttotal, margin_mode |
| cex
fxget
fxaccounts | 永续合约(结算币种=usdt或btc) | total, unrealised_pnl, available, point, bonus |
| cex
dclist
dcaccounts | 交割合约(结算币种=usdt) | total, unrealised_pnl, available |
| cex
optionslist
optionsaccount | 期权 | total
value, unrealisedpnl, available |
| cex
marginlist
marginaccounts | 逐仓杠杆 | currency_pair, mmr, base/quote (available/locked/borrowed/interest) |
| cex
tradfiquery
userassets | TradFi资产 | USDx余额, 保证金 |
| cex
earnlist
dualbalance, cex
earnlist
dualorders, cex
earnlist
structuredorders | 理财 | 灵活储蓄 / 双币投资 / 结构化产品 |
| cex
spotlist
spotaccount_book | 现货账户流水/账本 | 账本条目 |
账户名称映射(details键 → 显示名称)
| API键 | 显示名称 |
|---|
| spot | 现货账户 / 交易账户 |
| futures |
合约账户(USDT永续) |
| delivery | 交割合约账户 |
| options | 期权账户 |
| finance | 理财账户 |
| quant | 量化/机器人账户 |
| meme_box | Alpha账户 |
| margin | 逐仓杠杆账户 |
| cross_margin | 全仓杠杆账户 |
| payment | 支付账户(不计入总额) |
关键规则
- - 只读。不进行交易、转账或下单。
- TradFi / 支付:USDx和支付资产不计入CEX总额;单独显示。
- 统一账户:当保证金模式为classic/cross_margin/portfolio时,现货可能合并到交易账户中。请勿使用高级模式、S1/S2等内部术语。
- 交易对格式:合约使用无斜杠(BTCUSDT);现货/杠杆使用斜杠(BTC/USDT)。
- 精度:法币估值保留2位小数;小额资产(<$0.01)显示为<$0.01;理财昨日盈亏最多保留8位小数。
案例路由图
I. 总额与概览(案例1)
| 案例 | 触发短语 | MCP工具 | 输出 |
|---|
| 1 | 我有多少钱,显示我的CEX总资产,账户资产分布,账户概览,查看我的余额 | cexwalletgettotalbalance currency=USDT | 总金额,账户分布,币种分布;如有TradFi/支付则单独列出 |
II. 特定币种(案例2)
| 案例 | 触发短语 | MCP工具 | 输出 |
|---|
| 2 | 我有多少BTC,我有多少USDT | 并发:cexspotgetspotaccounts,cexunifiedgetunifiedaccounts,cexfxgetfxaccounts,cexdclistdcaccounts,cexmarginlistmarginaccounts,cexearnlistdualbalance等 | 持有的{币种}总额,按账户分布 |
III. 特定账户 + 币种(案例3)
| 案例 | 触发短语 | MCP工具 | 输出 |
|---|
| 3 | 我的现货账户里有多少USDT,我的现货账户里有多少BTC | cexspotgetspotaccounts currency={币种} 或 cexunifiedgetunifiedaccounts currency={币种} | 账户名称,总额,可用,冻结 |
IV. 子账户查询(案例4–15)
| 案例 | 账户 | 触发短语 | MCP工具 |
|---|
| 4 | 现货 | 我的现货账户里有什么,显示我的现货账户资产 | cexspotgetspotaccounts 或 cexunifiedgetunifiedaccounts |
| 5 |
合约 | 合约账户里有多少钱,USDT永续,BTC永续,交割 | cex
fxget
fxaccounts settle=usdt/btc,cex
dclist
dcaccounts |
| 6 | 交易(统一) | 交易账户里有多少钱,统一账户里有多少钱 | cex
unifiedget
unifiedaccounts |
| 7 | 期权 | 期权账户里有多少钱,显示我的期权资产 | cex
optionslist
optionsaccount 或 cex
unifiedget
unifiedaccounts |
| 8 | 理财 | 理财账户里有多少钱,显示我的理财账户资产 | cex
earnlist
dualbalance,cex
earnlist
dualorders,cex
earnlist
structuredorders |
| 9 | Alpha | Alpha账户里有多少钱,显示我的Alpha资产 | cex
walletget
totalbalance details.meme_box |
| 12 | 逐仓杠杆 | 逐仓杠杆账户里有多少钱,显示我的逐仓杠杆资产 | cex
marginlist
marginaccounts |
| 15 | TradFi | TradFi账户里有多少钱,显示我的TradFi资产 | cex
tradfiquery
userassets |
V. 账户流水(旧版5–7)
| 案例 |