1---2name: gate-exchange-assets3description: Gate Exchange asset and balance query skill covering TradFi, spot, futures, margin, options, finance, and Alpha. Use when user asks to check total assets, account balance, specific currency holdings, or sub-account assets across those lines. Trigger phrases: 'how much do I have', 'total assets', 'TradFi', '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 Assistant78## General Rules910⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.11Do NOT select or call any tool until all rules are read. These rules have the highest priority.12→ Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)13- **Only call MCP tools explicitly listed in this skill.** Tools not documented here must NOT be called, even if they14 exist in the MCP server.151617---1819## MCP Dependencies2021### Required MCP Servers22| MCP Server | Status |23|------------|--------|24| Gate (main) | ✅ Required |2526### MCP Tools Used2728**Query Operations (Read-only)**2930- cex_delivery_list_delivery_accounts31- cex_earn_list_dual_balance32- cex_earn_list_dual_orders33- cex_earn_list_structured_orders34- cex_fx_get_fx_accounts35- cex_margin_list_margin_accounts36- cex_options_list_options_account37- cex_spot_get_spot_accounts38- cex_spot_list_spot_account_book39- cex_tradfi_query_user_assets40- cex_unified_get_unified_accounts41- cex_wallet_get_total_balance4243### Authentication44- API Key Required: Yes (see skill doc/runtime MCP deployment)45- Permissions: Delivery:Read, Earn:Read, Fx:Read, Margin:Read, Options:Read, Spot:Read, Tradfi:Read, Unified:Read, Wallet:Read46- Get API Key: https://www.gate.io/myaccount/profile/api-key/manage4748### Installation Check49- Required: Gate (main)50- Install: Run installer skill for your IDE51 - Cursor: `gate-mcp-cursor-installer`52 - Codex: `gate-mcp-codex-installer`53 - Claude: `gate-mcp-claude-installer`54 - OpenClaw: `gate-mcp-openclaw-installer`5556## Domain Knowledge5758### MCP Tool Mapping (Gate gate-mcp)5960| MCP Tool | Purpose | Key Fields |61|----------|---------|------------|62| `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) |63| `cex_spot_get_spot_accounts` | Spot balance (filter by currency) | currency, available, locked |64| `cex_unified_get_unified_accounts` | Unified account (single/cross/portfolio margin) | balances, unified_account_total, margin_mode |65| `cex_fx_get_fx_accounts` | Perpetual (settle=usdt or btc) | total, unrealised_pnl, available, point, bonus |66| `cex_delivery_list_delivery_accounts` | Delivery (settle=usdt) | total, unrealised_pnl, available |67| `cex_options_list_options_account` | Options | total_value, unrealised_pnl, available |68| `cex_margin_list_margin_accounts` | Isolated margin | currency_pair, mmr, base/quote (available/locked/borrowed/interest) |69| `cex_tradfi_query_user_assets` | TradFi assets | USDx balance, margin |70| `cex_earn_list_dual_balance`, `cex_earn_list_dual_orders`, `cex_earn_list_structured_orders` | Finance | Flexible savings / Dual currency / Structured |71| `cex_spot_list_spot_account_book` | Spot account book / ledger | ledger entries |7273### Account Name Mapping (details key → Display)7475| API key | Display |76|---------|---------|77| spot | Spot account / Trading account |78| futures | Futures account (USDT perpetual) |79| delivery | Delivery contract account |80| options | Options account |81| finance | Finance account |82| quant | Quant/bot account |83| meme_box | Alpha account |84| margin | Isolated margin account |85| cross_margin | Cross margin account |86| payment | Payment account (not in total) |8788### Key Rules8990- **Read-only**. No trading, transfer, or order placement.91- **TradFi / payment**: USDx and payment assets are NOT included in CEX total; display separately.92- **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".93- **Pair format**: Futures use no-slash (BTCUSDT); spot/margin use slash (BTC/USDT).94- **Precision**: Fiat valuation 2 decimals; dust (<$0.01) show as `<$0.01`; finance yesterday PnL up to 8 decimals.9596## Case Routing Map9798### I. Total & Overview (Case 1)99100| Case | Trigger Phrases | MCP Tool | Output |101|------|-----------------|----------|--------|102| 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 |103104### II. Specific Currency (Case 2)105106| Case | Trigger Phrases | MCP Tool | Output |107|------|-----------------|----------|--------|108| 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 |109110### III. Specific Account + Currency (Case 3)111112| Case | Trigger Phrases | MCP Tool | Output |113|------|-----------------|----------|--------|114| 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 |115116### IV. Sub-Account Queries (Case 4–15)117118| Case | Account | Trigger Phrases | MCP Tool |119|------|---------|-----------------|----------|120| 4 | Spot | "What's in my spot account", "Show my spot account assets" | `cex_spot_get_spot_accounts` or `cex_unified_get_unified_accounts` |121| 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` |122| 6 | Trading (Unified) | "How much in trading account", "How much in unified account" | `cex_unified_get_unified_accounts` |123| 7 | Options | "How much in options account", "Show my options assets" | `cex_options_list_options_account` or `cex_unified_get_unified_accounts` |124| 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` |125| 9 | Alpha | "How much in Alpha account", "Show my Alpha assets" | `cex_wallet_get_total_balance` details.meme_box |126| 12 | Isolated Margin | "How much in isolated margin account", "Show my isolated margin assets" | `cex_margin_list_margin_accounts` |127| 15 | TradFi | "How much in TradFi account", "Show my TradFi assets" | `cex_tradfi_query_user_assets` |128129### V. Account Book (Legacy 5–7)130131| Case | Intent | MCP Tool |132|------|--------|----------|133| 5 | Account book for coin | `cex_spot_list_spot_account_book` |134| 6 | Ledger + current balance | `cex_spot_list_spot_account_book` → `cex_spot_get_spot_accounts` |135| 7 | Recent activity | `cex_spot_list_spot_account_book` |136137## Special Scenario Handling138139| Scenario | Handling |140|----------|----------|141| Total < 10 USDT | Show small-asset tip; recommend [Deposit] or [Dust conversion] |142| Unified account migration | "Your account is upgrading to unified account, asset data may be incomplete, please retry in ~5 minutes" |143| Dust (>10 dust coins) | "~${total_val} dust across {N} currencies" → [Dust conversion] |144| API timeout/error | "Data fetch error, please retry later" → [Refresh] |145| Account/coin balance = 0 | Do NOT show "your xx account is 0"; skip that item |146| USDT + TradFi | Show TradFi (USDx) separately; "TradFi in USDx, 1:1 with USDT, not in CEX total" |147| GTETH / voucher tokens | Explain: On-chain earn voucher, cannot withdraw to chain |148| ST token | Risk warning, suggest checking official announcements |149| Delisted token | Explain delisting, suggest withdrawal |150| Unified account, user asks "spot" | Inform spot merged into trading account; show trading account balance |151152## Output Templates153154**Case 1 – Total Balance:**155```156Your total CEX asset valuation ≈ ${total.amount} USDT157🕒 Updated: {time} (UTC+8)158💰 Account distribution: details keys (spot/futures/delivery etc.) amount, show only amount > 0159```160161**Case 2 – Specific Currency:**162```163You hold {total_qty} {COIN} (≈ ${total_val} USDT)164🕒 Updated: {time} (UTC+8)165💰 Asset distribution: {account}: {qty} {COIN}, ≈ ${val} ({pct}%)166```167168**Case 15 – TradFi:**169```170Your TradFi account details:171Net value: {net_value} USDx | Balance: {balance} USDx | Unrealised PnL: {unrealised_pnl} USDx172Margin: {margin} USDx | Available margin: {available_margin} USDx | Margin ratio: {ratio}% (max 999+%)173⚠ TradFi account in USDx, 1:1 with USDT, not in CEX total valuation.174```175176## Acceptance Test Queries (Validation)177178| Scenario | Query |179|----------|-------|180| Total balance – normal | How much do I have? |181| Total balance – overview | Show my CEX total assets |182| Total balance – small (<10U) | My account asset distribution |183| Specific currency – normal | How many BTC do I have? |184| Specific currency – zero | How much DOGE do I have? |185| Specific account+currency | How much USDT in my spot account? |186| Spot account | What's in my spot account? |187| Futures – with assets | How much in futures account |188| Futures – USDT+BTC perpetual | Show my perpetual contract assets |189| Futures – no assets | Show my USDT perpetual assets |190| Trading account | How much in trading account |191| Options | Show my options assets |192| Alpha | How much in Alpha account |193| Isolated margin | Show my isolated margin assets |194| TradFi | How much in TradFi account |195196## Cross-Skill Workflows197198- **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.199- **After transfer**: Route to this skill for updated balance when user asks.200- **Transfer card**: When futures/options = 0, recommend [Transfer] and trigger transfer skill.201202## Safety Rules203204- **Read-only only**. Never call create_order, cancel_order, create_transfer, or any write operation.205- If user intent includes trading, transfer, or order placement → route to appropriate skill.206- Always clarify currency and scope (spot vs all wallets) when ambiguous.207208For detailed scenario templates and edge cases, see [references/scenarios.md](references/scenarios.md).