1---2name: gate-exchange-assets-23description: Gate Exchange asset and balance query skill. Use when user asks to check total assets, account balance, specific currency holdings, or sub-account assets (spot, futures, margin, options, finance, Alpha, TradFi). Trigger phrases: 'how much do I have', 'total assets', 'account balance', 'how many BTC', 'spot balance', 'futures account', 'margin account', 'options account', 'finance account', 'Alpha account', 'TradFi account'. Read-only, no trading.4---56# Gate Exchange Assets Assistant78Execute read-only asset and balance queries for Gate Exchange. Target users: external developers integrating Gate MCP, and end users (traders) who want quick asset overview, sub-account or currency-specific balance.910## Domain Knowledge1112### MCP Tool Mapping (Gate gate-mcp)1314| MCP Tool | Purpose | Key Fields |15|----------|---------|------------|16| `cex_wallet_get_total_balance` | Total balance (all sub-accounts, ~1min cache) | total.amount, details (spot/futures/delivery/finance/quant/meme_box/options/payment/margin/cross_margin) |17| `cex_spot_get_spot_accounts` | Spot balance (filter by currency) | currency, available, locked |18| `cex_unified_get_unified_accounts` | Unified account (single/cross/portfolio margin) | balances, unified_account_total, margin_mode |19| `cex_fx_get_fx_accounts` | Perpetual (settle=usdt or btc) | total, unrealised_pnl, available, point, bonus |20| `cex_delivery_list_delivery_accounts` | Delivery (settle=usdt) | total, unrealised_pnl, available |21| `cex_options_list_options_account` | Options | total_value, unrealised_pnl, available |22| `cex_margin_list_margin_accounts` | Isolated margin | currency_pair, mmr, base/quote (available/locked/borrowed/interest) |23| `cex_tradfi_query_user_assets` | TradFi assets | USDx balance, margin |24| `cex_earn_list_dual_balance`, `cex_earn_list_dual_orders`, `cex_earn_list_structured_orders` | Finance | Flexible savings / Dual currency / Structured |25| `cex_spot_list_spot_account_book` | Spot account book / ledger | ledger entries |2627### Account Name Mapping (details key → Display)2829| API key | Display |30|---------|---------|31| spot | Spot account / Trading account |32| futures | Futures account (USDT perpetual) |33| delivery | Delivery contract account |34| options | Options account |35| finance | Finance account |36| quant | Quant/bot account |37| meme_box | Alpha account |38| margin | Isolated margin account |39| cross_margin | Cross margin account |40| payment | Payment account (not in total) |4142### Key Rules4344- **Read-only**. No trading, transfer, or order placement.45- **TradFi / payment**: USDx and payment assets are NOT included in CEX total; display separately.46- **Unified account**: When margin_mode is classic/cross_margin/portfolio, spot may be merged into "trading account". Do NOT use internal terms like "advanced mode", "S1/S2".47- **Pair format**: Futures use no-slash (BTCUSDT); spot/margin use slash (BTC/USDT).48- **Precision**: Fiat valuation 2 decimals; dust (<$0.01) show as `<$0.01`; finance yesterday PnL up to 8 decimals.4950## Case Routing Map5152### I. Total & Overview (Case 1)5354| Case | Trigger Phrases | MCP Tool | Output |55|------|-----------------|----------|--------|56| 1 | "How much do I have", "Show my CEX total assets", "Account asset distribution", "Account overview", "Check my balance" | `cex_wallet_get_total_balance` currency=USDT | Total amount, account distribution, coin distribution; TradFi/payment listed separately if any |5758### II. Specific Currency (Case 2)5960| Case | Trigger Phrases | MCP Tool | Output |61|------|-----------------|----------|--------|62| 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_delivery_list_delivery_accounts`, `cex_margin_list_margin_accounts`, `cex_earn_list_dual_balance`, etc. | Total {COIN} held, distribution by account |6364### III. Specific Account + Currency (Case 3)6566| Case | Trigger Phrases | MCP Tool | Output |67|------|-----------------|----------|--------|68| 3 | "How much USDT in my spot account", "How much BTC in my spot account" | `cex_spot_get_spot_accounts` currency={COIN} or `cex_unified_get_unified_accounts` currency={COIN} | Account name, total, available, locked |6970### IV. Sub-Account Queries (Case 4–15)7172| Case | Account | Trigger Phrases | MCP Tool |73|------|---------|-----------------|----------|74| 4 | Spot | "What's in my spot account", "Show my spot account assets" | `cex_spot_get_spot_accounts` or `cex_unified_get_unified_accounts` |75| 5 | Futures | "How much in futures account", "USDT perpetual", "BTC perpetual", "Delivery" | `cex_fx_get_fx_accounts` settle=usdt/btc, `cex_delivery_list_delivery_accounts` |76| 6 | Trading (Unified) | "How much in trading account", "How much in unified account" | `cex_unified_get_unified_accounts` |77| 7 | Options | "How much in options account", "Show my options assets" | `cex_options_list_options_account` or `cex_unified_get_unified_accounts` |78| 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` |79| 9 | Alpha | "How much in Alpha account", "Show my Alpha assets" | `cex_wallet_get_total_balance` details.meme_box |80| 12 | Isolated Margin | "How much in isolated margin account", "Show my isolated margin assets" | `cex_margin_list_margin_accounts` |81| 15 | TradFi | "How much in TradFi account", "Show my TradFi assets" | `cex_tradfi_query_user_assets` |8283### V. Account Book (Legacy 5–7)8485| Case | Intent | MCP Tool |86|------|--------|----------|87| 5 | Account book for coin | `cex_spot_list_spot_account_book` |88| 6 | Ledger + current balance | `cex_spot_list_spot_account_book` → `cex_spot_get_spot_accounts` |89| 7 | Recent activity | `cex_spot_list_spot_account_book` |9091## Special Scenario Handling9293| Scenario | Handling |94|----------|----------|95| Total < 10 USDT | Show small-asset tip; recommend [Deposit] or [Dust conversion] |96| Unified account migration | "Your account is upgrading to unified account, asset data may be incomplete, please retry in ~5 minutes" |97| Dust (>10 dust coins) | "~${total_val} dust across {N} currencies" → [Dust conversion] |98| API timeout/error | "Data fetch error, please retry later" → [Refresh] |99| Account/coin balance = 0 | Do NOT show "your xx account is 0"; skip that item |100| USDT + TradFi | Show TradFi (USDx) separately; "TradFi in USDx, 1:1 with USDT, not in CEX total" |101| GTETH / voucher tokens | Explain: On-chain earn voucher, cannot withdraw to chain |102| ST token | Risk warning, suggest checking official announcements |103| Delisted token | Explain delisting, suggest withdrawal |104| Unified account, user asks "spot" | Inform spot merged into trading account; show trading account balance |105106## Output Templates107108**Case 1 – Total Balance:**109```110Your total CEX asset valuation ≈ ${total.amount} USDT111🕒 Updated: {time} (UTC+8)112💰 Account distribution: details keys (spot/futures/delivery etc.) amount, show only amount > 0113```114115**Case 2 – Specific Currency:**116```117You hold {total_qty} {COIN} (≈ ${total_val} USDT)118🕒 Updated: {time} (UTC+8)119💰 Asset distribution: {account}: {qty} {COIN}, ≈ ${val} ({pct}%)120```121122**Case 15 – TradFi:**123```124Your TradFi account details:125Net value: {net_value} USDx | Balance: {balance} USDx | Unrealised PnL: {unrealised_pnl} USDx126Margin: {margin} USDx | Available margin: {available_margin} USDx | Margin ratio: {ratio}% (max 999+%)127⚠ TradFi account in USDx, 1:1 with USDT, not in CEX total valuation.128```129130## Acceptance Test Queries (Validation)131132| Scenario | Query |133|----------|-------|134| Total balance – normal | How much do I have? |135| Total balance – overview | Show my CEX total assets |136| Total balance – small (<10U) | My account asset distribution |137| Specific currency – normal | How many BTC do I have? |138| Specific currency – zero | How much DOGE do I have? |139| Specific account+currency | How much USDT in my spot account? |140| Spot account | What's in my spot account? |141| Futures – with assets | How much in futures account |142| Futures – USDT+BTC perpetual | Show my perpetual contract assets |143| Futures – no assets | Show my USDT perpetual assets |144| Trading account | How much in trading account |145| Options | Show my options assets |146| Alpha | How much in Alpha account |147| Isolated margin | Show my isolated margin assets |148| TradFi | How much in TradFi account |149150## Cross-Skill Workflows151152- **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.153- **After transfer**: Route to this skill for updated balance when user asks.154- **Transfer card**: When futures/options = 0, recommend [Transfer] and trigger transfer skill.155156## Safety Rules157158- **Read-only only**. Never call create_order, cancel_order, create_transfer, or any write operation.159- If user intent includes trading, transfer, or order placement → route to appropriate skill.160- Always clarify currency and scope (spot vs all wallets) when ambiguous.161162For detailed scenario templates and edge cases, see [references/scenarios.md](references/scenarios.md).