Gate Exchange Transfer (Internal Transfer)
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.
Execute same-UID internal transfers between Gate trading accounts: spot, isolated margin, perpetual, delivery, and options. Single execution endpoint: POST /wallet/transfers (MCP: cex_wallet_create_transfer).
Scope (Phase 1)
- - Supported: internal transfer only (same UID, between account types above).
- Not supported: main-to-sub, sub-to-main, sub-to-sub.
MCP Dependencies
Required MCP Servers
| MCP Server | Status |
|---|
| Gate (main) | ✅ Required |
MCP Tools Used
Query Operations (Read-only)
- - cexdclistdcaccountbook
- cexfxlistfxaccountbook
- cexmarginlistmarginaccountbook
- cexoptionslistoptionsaccountbook
- cexspotlistspotaccount_book
Execution Operations (Write)
- - cexwalletcreate_transfer
Authentication
- - Credentials Source: Local Gate MCP deployment (
GATE_API_KEY, GATE_API_SECRET) - API Key Required: Yes
- Permissions: Delivery:Read, Fx:Read, Margin:Read, Options:Read, Spot:Read, Wallet:Write
- 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 transfer workflow.
- -
SKILL.md keeps transfer intent routing and account-type mapping. - INLINECODE7 is the authoritative MCP execution layer for transfer pre-check, confirmation gate, execution, and ledger verification.
Preconditions
| Precondition | If not met |
|---|
| User logged in | Do not call API; prompt to log in (exception flow). |
| Account mode known |
Infer from context or assume classic: Spot ↔ USDT perpetual. For unified/trading account advanced mode: Trading account ↔ BTC perpetual. |
| Source balance verifiable | Call balance API for
from account before showing draft; if unavailable, prompt user to check on web. |
The Four Elements
Every internal transfer is fully specified by four elements. The assistant must resolve or infer them before showing a Transfer Draft.
| Element | API param | Required when | Notes |
|---|
| From | INLINECODE9 | Always | spot \ | margin \ | futures \ | delivery \ | options |
| To |
to | Always | Same enum as
from |
|
Currency |
currency | Always | USDT, BTC, etc. (platform-supported). Missing → auto-complete by target (case2). |
|
Amount |
amount | Always | String, > 0, up to 8 decimals. Missing → ask user (case8). |
Conditional params
- - margin:
currency_pair required (e.g. BTC_USDT) when from or to is margin. - futures / delivery:
settle required (usdt \| btc) when from or to is futures or delivery.
Public API (Phase 1)
| Endpoint | Method | Meaning | Rate limit |
|---|
| INLINECODE26 | POST | Same-UID internal transfer | 80 req/10s |
Tool Mapping
| Group | Tool (jsonrpc: call.method) |
|---|
| Main account internal transfer | INLINECODE28 |
Case Index
| Case | Scenario | Action |
|---|
| case1 | All four elements present | Show Transfer Draft → confirm → call API → Transfer Result Report |
| case2 |
Currency missing | Auto-complete currency by target account → same as case1 |
| case3 | Transfer completed (API success) | Output Transfer Result Report + product suggestion |
| case4 | Insufficient balance | Pre-check fails; no API call; show shortfall and suggest deposit/adjust |
| case5 | Missing from/to or ambiguous intent | Show missing-info card; do not call API |
| case6 | Account mode conflict (e.g. trading account → USDT perpetual not allowed) | Explain and suggest alternative path |
| case7 | Currency vs To mismatch (e.g. USDT to BTC perpetual) | Auto-correct or prompt correction → then case1 |
| case8 | Amount missing | Ask for amount; after user provides, proceed to case1/case2 |
| case9 | User cancels or declines after draft | Acknowledge; do not call API |
| case10 | Confirmation ambiguous or stale | Re-present draft; ask for explicit "Confirm" / "Yes"; do not execute |
| case11 | Rate limit / service error | Do not retry blindly; prompt retry later or use web UI |
Transfer Draft (Mandatory before execution)
Before calling cex_wallet_create_transfer, output a Transfer Draft and wait for explicit confirmation in the immediately following user turn.
Draft contents
- -
from (account name) - INLINECODE31 (account name)
- INLINECODE32
- INLINECODE33
- If applicable:
settle (for futures/delivery), currency_pair (for margin)
Confirmation rule
- - Treat confirmation as single-use. If user changes amount, currency, or direction, show a new draft and re-confirm.
- If user does not clearly confirm (e.g. "Confirm", "Yes", "Proceed"), do not execute (case10).
Transfer Result Report (After successful API call)
- - Confirm success: e.g. "Transfer successful. {amount} {currency} has arrived in your {to account name}."
- Optionally suggest next step by destination: Spot → spot trading; USDT perpetual → USDT-margined perpetual; etc.
- Mention transfer history: e.g. transfer/historyV2 or equivalent MCP tool.
Case Logic and Output
case1: All four elements present
Trigger
"Transfer 100 USDT from my spot account to perpetual futures account" / "Transfer 1000 USDT from spot to USDT-margined futures" / "Transfer 0.5 BTC from coin-margined to spot"
Steps
- 1. Resolve
from, to, currency, amount; add settle or currency_pair if needed. - Pre-check: fetch source balance; if balance < amount → case4.
- Output Transfer Draft.
- Wait for explicit confirmation.
- Call
cex_wallet_create_transfer. - Output Transfer Result Report (case3).
Request mapping
| Intent | API parameter | Values |
|---|
| Source account | INLINECODE43 | spot \ | margin \ | futures \ | delivery \ | options |
| Target account |
to | spot \| margin \| futures \| delivery \| options |
| Currency |
currency | USDT, BTC, etc. |
| Amount |
amount | String, > 0, up to 8 decimals |
| Margin pair |
currency_pair | Required if from/to is margin, e.g. BTC_USDT |
| Settlement |
settle | Required if from/to is futures or delivery: usdt \| btc |
case2: Currency missing, auto-complete
Trigger
"Transfer 100 to my USDT-margined account" / "Transfer 500 to futures" / "Transfer 1000 to perpetual"
Logic
Set currency by target account:
| Target account | Default currency |
|---|
| USDT perpetual (futures settle=usdt) | USDT |
| BTC perpetual (futures settle=btc) |
BTC |
| TradFi | USDT |
| Delivery | USDT |
| Options | USDT |
| Spot / margin | Infer from context or ask |
Steps
Same as case1 after currency is set.
Output (draft)
"Detected transfer of {amount} to {to account name}. Based on account type, default currency is {currency}. Please confirm."
case3: Transfer completed (API success)
Trigger
User confirmed; cex_wallet_create_transfer returned success.
Output
- - "Transfer successful. {amount} {currency} has arrived in your {to account name}."
- Optional: product suggestion by destination (spot / USDT perpetual / BTC perpetual / delivery / margin / TradFi / options).
- "Transfer history: transfer/historyV2" (or equivalent).
case4: Insufficient balance
Trigger
Pre-check: source available balance < transfer amount.
Action
Do not call transfer API.
Output
"Your {from account name} has insufficient balance (available: {available} {currency}). Please adjust the amount or deposit first."
case5: Missing from/to or ambiguous intent
Trigger
"Contract is about to be liquidated, transfer some funds for margin" / "Top up my futures margin" / "How do I adjust account funds"
Logic
- - If missing ≥ 2 of from, to, currency, amount: show missing-info card and ask user to provide.
- Defaults when only one side is clear:
- Unified/trading account advanced mode: default from = Trading account, to = BTC perpetual.
- Classic: default from = Spot, to = USDT perpetual.
- - Do not call API until four elements are clear.
Output
"I can help with margin top-up. Please specify: from account, to account, and currency (and amount if you know it)."
case6: Account mode conflict
Trigger
User in trading account advanced mode asks to transfer to USDT perpetual. In this mode, direct transfer to USDT perpetual may be disallowed (path not available).
Output
"You are in trading account mode; direct transfer to USDT perpetual is not available. You can transfer to BTC perpetual (coin-margined) instead, or adjust account mode on the web."
case7: Currency vs To account mismatch
Trigger
"Transfer some USDT to my BTC perpetual account"
Logic
BTC perpetual settles in BTC; USDT is inconsistent.
- - Option A: Correct to BTC amount (if user intent allows).
- Option B: Explain that BTC perpetual uses BTC; suggest transferring BTC or using USDT perpetual for USDT.
- If user confirms a corrected draft (e.g. spot → BTC perpetual with BTC), proceed as case1.
Output
"BTC perpetual uses BTC settlement. I've corrected the transfer to use BTC (or: please specify amount in BTC). Please confirm." Or: "For USDT, use USDT perpetual account instead."
case8: Amount missing
Trigger
"Transfer USDT from spot to futures" / "Move my USDT to perpetual" (no amount).
Action
Ask: "How much {currency} do you want to transfer from {from} to {to}?" After user provides amount, resolve currency if still missing (case2), then proceed to case1.
case9: User cancels or declines
Trigger
After Transfer Draft, user says "No" / "Cancel" / "Don't do it" / "Never mind".
Action
Do not call API. Acknowledge: "Transfer cancelled. No changes made."
case10: Confirmation ambiguous or stale
Trigger
After draft, user replies with something other than clear confirmation (e.g. new question, different amount, or vague "ok" in a long thread).
Action
Do not execute. Re-present the Transfer Draft and say: "To execute this transfer, please confirm explicitly (e.g. 'Confirm' or 'Yes')."
case11: Rate limit or service error
Trigger
API returns TOO_MANY_REQUESTS or server/network error.
Action
Do not retry automatically in the same turn.
Output
"Request failed (rate limit / service error). Please try again later or use the web app to transfer."
Exception Flow Summary
| Exception | Handling | Block execution |
|---|
| Not logged in | Prompt to log in | Yes |
| Insufficient balance |
Show shortfall + suggest deposit/adjust (case4) | Yes |
| Invalid account path (e.g. from/to not allowed) | Guide user to correct (case5/case6) | No, guide |
| User cancel / decline | Acknowledge (case9) | Yes |
| Confirmation missing/ambiguous | Re-present draft, ask explicit confirm (case10) | Yes |
| Rate limit / service error | Retry later or use web (case11) | Yes |
| Risk control / quota | Show clear reason | Yes |
API Reference
Request body example
CODEBLOCK0
from / to → product name
| API value | Product name |
|---|
| spot | Spot |
| margin |
Isolated margin |
| futures | Perpetual (use
settle) |
| delivery | Delivery |
| options | Options |
settle (futures / delivery)
| settle | Account |
|---|
| usdt | USDT perpetual |
| btc |
BTC perpetual |
currency_pair (margin)
Required when from or to is margin; e.g. BTC_USDT.
Transfer History Query
After a transfer, user may ask for history. By account type:
| Account | Query tool (if MCP provides) | Notes |
|---|
| Spot | INLINECODE58 | currency, time, limit |
| Perpetual |
cex_fx_list_fx_account_book | settle, type=dnw |
| Delivery |
cex_dc_list_dc_account_book | settle, type=dnw |
| Margin |
cex_margin_list_margin_account_book | currency_pair, time, limit |
| Options |
cex_options_list_options_account_book | per MCP docs |
REST: Delivery GET /delivery/{settle}/accountbook?type=dnw; Perpetual GET /futures/{settle}/accountbook?type=dnw; Margin GET /margin/account_book.
Error Codes
| Code | Meaning |
|---|
| BALANCENOTENOUGH | Insufficient balance; do not retry same amount |
| TOOMANYREQUESTS |
Rate limit; prompt retry later (case11) |
| QUOTA
NOTENOUGH | Quota exceeded; show message |
Execution Rules (Summary)
- 1. Single endpoint: Internal transfer only via
POST /wallet/transfers (cex_wallet_create_transfer). No main-sub in Phase 1. - Always show Transfer Draft with from, to, currency, amount (and settle/currency_pair if needed).
- Require explicit confirmation in the next user turn; single-use; re-confirm if params change.
- Pre-check balance before calling API; on insufficient balance, follow case4 and do not call.
- Conditional params:
currency_pair for margin; settle for futures/delivery. - Missing currency: case2 default table. Missing amount: case8 ask.
- Account mode / currency mismatch: case6 and case7; resolve or correct before executing.
- On cancel or ambiguous confirm: case9/case10; do not execute.
Gate交易所转账(内部转账)
通用规则
⚠️ 注意——在执行前,您必须阅读并严格遵守共享的运行时规则。
在阅读所有规则之前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读 ./references/gate-runtime-rules.md
- - 仅调用本技能中明确列出的MCP工具。 即使MCP服务器中存在未在此处记录的工具,也不得调用。
在Gate交易账户之间执行相同UID的内部转账:现货、逐仓保证金、永续合约、交割合约和期权。单一执行端点:POST /wallet/transfers(MCP:cexwalletcreate_transfer)。
范围(第一阶段)
- - 支持:仅限内部转账(相同UID,上述账户类型之间)。
- 不支持:主账户到子账户、子账户到主账户、子账户到子账户。
MCP依赖项
所需MCP服务器
使用的MCP工具
查询操作(只读)
- - cexdclistdcaccountbook
- cexfxlistfxaccountbook
- cexmarginlistmarginaccountbook
- cexoptionslistoptionsaccountbook
- cexspotlistspotaccount_book
执行操作(写入)
- - cexwalletcreate_transfer
认证
- - 凭证来源:本地Gate MCP部署(GATEAPIKEY、GATEAPISECRET)
- 需要API密钥:是
- 权限:交割:读取、合约:读取、保证金:读取、期权:读取、现货:读取、钱包:写入
- 切勿要求用户将密钥粘贴到聊天中;仅依赖已配置的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执行层。
前置条件
| 前置条件 | 如果不满足 |
|---|
| 用户已登录 | 不调用API;提示登录(异常流程)。 |
| 账户模式已知 |
从上下文推断或假设经典模式:现货 ↔ USDT永续。对于统一/交易账户高级模式:交易账户 ↔ BTC永续。 |
| 源余额可验证 | 在显示草稿前调用余额API获取from账户;如果不可用,提示用户在网页上检查。 |
四个要素
每次内部转账由四个要素完整指定。助手必须在显示转账草稿之前解析或推断它们。
| 要素 | API参数 | 何时必需 | 备注 |
|---|
| 来源 | from | 始终 | spot \ | margin \ | futures \ | delivery \ | options |
| 目标 |
to | 始终 | 与from相同的枚举 |
|
币种 | currency | 始终 | USDT、BTC等(平台支持)。缺失 → 按目标自动补全(案例2)。 |
|
金额 | amount | 始终 | 字符串,> 0,最多8位小数。缺失 → 询问用户(案例8)。 |
条件参数
- - margin:当from或to为margin时,需要currencypair(例如BTCUSDT)。
- futures / delivery:当from或to为futures或delivery时,需要settle(usdt \| btc)。
公共API(第一阶段)
| 端点 | 方法 | 含义 | 速率限制 |
|---|
| /wallet/transfers | POST | 相同UID内部转账 | 80次/10秒 |
工具映射
| 分组 | 工具(jsonrpc: call.method) |
|---|
| 主账户内部转账 | cexwalletcreate_transfer |
案例索引
| 案例 | 场景 | 操作 |
|---|
| case1 | 四个要素齐全 | 显示转账草稿 → 确认 → 调用API → 转账结果报告 |
| case2 |
币种缺失 | 按目标账户自动补全币种 → 同case1 |
| case3 | 转账完成(API成功) | 输出转账结果报告 + 产品建议 |
| case4 | 余额不足 | 预检查失败;不调用API;显示差额并建议存款/调整 |
| case5 | 缺少from/to或意图不明确 | 显示缺失信息卡片;不调用API |
| case6 | 账户模式冲突(例如交易账户 → USDT永续不允许) | 解释并建议替代路径 |
| case7 | 币种与目标账户不匹配(例如USDT到BTC永续) | 自动纠正或提示纠正 → 然后case1 |
| case8 | 金额缺失 | 询问金额;用户提供后,进入case1/case2 |
| case9 | 用户取消或拒绝草稿 | 确认;不调用API |
| case10 | 确认模糊或过期 | 重新显示草稿;要求明确确认/是;不执行 |
| case11 | 速率限制/服务错误 | 不盲目重试;提示稍后重试或使用网页界面 |
转账草稿(执行前必需)
在调用cexwalletcreate_transfer之前,输出转账草稿并等待用户在紧接着的下一个轮次中明确确认。
草稿内容
- - from(账户名称)
- to(账户名称)
- currency
- amount
- 如适用:settle(用于期货/交割),currency_pair(用于保证金)
确认规则
- - 将确认视为一次性使用。如果用户更改金额、币种或方向,显示新草稿并重新确认。
- 如果用户未明确确认(例如确认、是、继续),则不执行(case10)。
转账结果报告(API调用成功后)
- - 确认成功:例如转账成功。{amount} {currency}已到达您的{to account name}。
- 可选:按目标建议下一步操作:现货 → 现货交易;USDT永续 → USDT保证金永续;等。
- 提及转账历史:例如transfer/historyV2或等效的MCP工具。
案例逻辑和输出
case1:四个要素齐全
触发条件
从我的现货账户转账100 USDT到永续合约账户 / 从现货转账1000 USDT到USDT保证金期货 / 从币本位合约转账0.5 BTC到现货
步骤
- 1. 解析from、to、currency、amount;如有需要添加settle或currencypair。
- 预检查:获取源余额;如果余额 < 金额 → case4。
- 输出转账草稿。
- 等待明确确认。
- 调用cexwalletcreatetransfer。
- 输出转账结果报告(case3)。
请求映射
| 意图 | API参数 | 值 |
|---|
| 源账户 | from | spot \ | margin \ | futures \ | delivery \ | options |
| 目标账户 |
to | spot \| margin \| futures \| delivery \| options |
| 币种 | currency | USDT、BTC等 |
| 金额 | amount | 字符串,> 0,最多8位小数 |
| 保证金交易对 | currency
pair | 如果from/to为margin则必需,例如BTCUSDT |
| 结算币种 | settle | 如果from/to为futures或delivery则必需:usdt \| btc |
case2:币种缺失,自动补全
触发条件
转账100到我的USDT保证金账户 / 转账500到期货 / 转账1000到永续合约
逻辑
按目标账户设置currency:
| 目标账户 | 默认币种 |
|---|
| USDT永续(futures settle=usdt) | USDT |
| BTC永