Gate Exchange Assets
by @gaixianggeng
Gate multi-account asset and balance query skill. Use when the user asks to check total assets, account balance, or specific coin holdings across all account...
clawhub install gate-exchange-assets-stagingπ About This Skill
name: gate-exchange-assets version: "2026.4.8-1" updated: "2026-04-08" description: "Gate multi-account asset and balance query skill. Use when the user asks to check total assets, account balance, or specific coin holdings across all accounts. Triggers on 'total assets', 'my balance', 'how many BTC do I have'. Read-only." required_credentials: - gate_api_key - gate_api_secret required_env_vars: - GATE_API_KEY - GATE_API_SECRET required_permissions: - Delivery:Read - Earn:Read - Fx:Read - Margin:Read - Options:Read - Spot:Read - Tradfi:Read - Unified:Read - Wallet:Read metadata: openclaw: requires: env: - GATE_API_KEY - GATE_API_SECRET primaryEnv: GATE_API_KEY homepage: https://github.com/gate/gate-skills
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
MCP Dependencies
Required MCP Servers
| MCP Server | Status | |------------|--------| | Gate (main) | β Required |MCP Tools Used
Query Operations (Read-only)
Authentication
GATE_API_KEY, GATE_API_SECRET)Installation Check
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.references/mcp.md 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 |
|----------|---------|------------|
| 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) |
| cex_spot_get_spot_accounts | Spot balance (filter by currency) | currency, available, locked |
| cex_unified_get_unified_accounts | Unified account (single/cross/portfolio margin) | balances, unified_account_total, 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, unrealised_pnl, 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
<$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" | cex_wallet_get_total_balance 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" | cex_spot_get_spot_accounts 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" | cex_spot_get_spot_accounts or cex_unified_get_unified_accounts |
| 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 | cex_spot_list_spot_account_book |
| 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:
Your total CEX asset valuation β ${total.amount} USDT
π Updated: {time} (UTC+8)
π° Account distribution: details keys (spot/futures/delivery etc.) amount, show only amount > 0
Case 2 β Specific Currency:
You hold {total_qty} {COIN} (β ${total_val} USDT)
π Updated: {time} (UTC+8)
π° Asset distribution: {account}: {qty} {COIN}, β ${val} ({pct}%)
Case 15 β TradFi:
Your TradFi account details:
Net value: {net_value} USDx | Balance: {balance} USDx | Unrealised PnL: {unrealised_pnl} USDx
Margin: {margin} USDx | Available margin: {available_margin} USDx | Margin ratio: {ratio}% (max 999+%)
β TradFi account in USDx, 1:1 with USDT, not in CEX total valuation.
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
cex_spot_get_spot_accounts currency=USDT β Route to gate-exchange-spot if sufficient.Safety Rules
For detailed scenario templates and edge cases, see references/scenarios.md.