gate-exchange-tradfi
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate TradFi Suite
Gate TradFi 工具套件
Read and follow the shared runtime rules before proceeding:
→ exchange-runtime-rules.md
This skill is the single entry for Gate TradFi (traditional finance). All MCP tools used are prefixed with . It supports query modules (orders, positions, market, assets) and trading modules (place order, amend order, cancel order, modify position, close position). Read the MCP tool definitions for exact tool names, parameters, and value constraints; declare conditions and limits in this skill and in each reference.
cex_tradfi在开始操作前,请阅读并遵循共享的运行时规则:
→ exchange-runtime-rules.md
本Skill是Gate TradFi(传统金融)的唯一入口,所使用的所有MCP工具均以为前缀。它支持查询模块(订单、持仓、市场、资产)和交易模块(下单、修改订单、取消订单、调整持仓、平仓)。请查阅MCP工具定义以了解确切的工具名称、参数和值约束;在本Skill及每个参考文档中声明条件和限制。
cex_tradfiSub-Modules
子模块
| Module | Description | Trigger keywords |
|---|---|---|
| Query orders | Order list, order history | |
| Query positions | Current position list, position history | |
| Query market | Category list, symbol list, ticker, symbol kline | |
| Query assets | User balance/asset info, MT5 account info | |
| Place order | Create new order (supports take-profit/stop-loss at creation) | |
| Amend order | Change order price, take-profit, or stop-loss (size not supported) | |
| Cancel order | Cancel one or more orders | |
| Modify position | Change position take-profit/stop-loss only (leverage, margin not supported) | |
| Close position | Full or partial close | |
| 模块 | 描述 | 触发关键词 |
|---|---|---|
| 查询订单 | 订单列表、订单历史 | |
| 查询持仓 | 当前持仓列表、持仓历史 | |
| 查询市场 | 品类列表、交易对列表、行情报价、交易对K线 | |
| 查询资产 | 用户余额/资产信息、MT5账户信息 | |
| 下单 | 创建新订单(支持在创建时设置止盈/止损) | |
| 修改订单 | 更改订单价格、止盈或止损(不支持修改订单规模) | |
| 取消订单 | 取消一个或多个订单 | |
| 调整持仓 | 仅修改持仓的止盈/止损价格(不支持修改杠杆、保证金) | |
| 平仓 | 全部或部分平仓 | |
Routing Rules
路由规则
| Intent | Example phrases | Route to |
|---|---|---|
| Query orders | "My TradFi orders", "order history", "show open orders", "order status" | Read |
| Query positions | "My positions", "position history", "current holdings", "what am I holding" | Read |
| Query market | "TradFi categories", "category list", "symbol list", "ticker", "kline for X", "market data" | Read |
| Query assets | "My assets", "balance", "account balance", "MT5 account", "my MT5 info" | Read |
| Place order | "Place order", "buy EURUSD", "sell XAUUSD 0.1", "open long", "order with take-profit/stop-loss" | Read |
| Amend order | "Amend order", "change price to X", "take-profit", "stop-loss" | Read |
| Cancel order | "Cancel order", "cancel all orders", "revoke order" | Read |
| Modify position | "Modify position", "take-profit", "stop-loss", "change take-profit/stop-loss" | Read |
| Close position | "Close position", "close all", "close half", "flat" | Read |
| Unclear | "TradFi", "show me my TradFi" | Clarify: list query and trading modules or ask which the user wants. |
| 意图 | 示例短语 | 路由至 |
|---|---|---|
| 查询订单 | "My TradFi orders", "order history", "show open orders", "order status" | 阅读 |
| 查询持仓 | "My positions", "position history", "current holdings", "what am I holding" | 阅读 |
| 查询市场 | "TradFi categories", "category list", "symbol list", "ticker", "kline for X", "market data" | 阅读 |
| 查询资产 | "My assets", "balance", "account balance", "MT5 account", "my MT5 info" | 阅读 |
| 下单 | "Place order", "buy EURUSD", "sell XAUUSD 0.1", "open long", "order with take-profit/stop-loss" | 阅读 |
| 修改订单 | "Amend order", "change price to X", "take-profit", "stop-loss" | 阅读 |
| 取消订单 | "Cancel order", "cancel all orders", "revoke order" | 阅读 |
| 调整持仓 | "Modify position", "take-profit", "stop-loss", "change take-profit/stop-loss" | 阅读 |
| 平仓 | "Close position", "close all", "close half", "flat" | 阅读 |
| 意图不明确 | "TradFi", "show me my TradFi" | 澄清: 列出查询和交易模块,或询问用户需求。 |
MCP Tools
MCP工具
Query (read-only) — use only MCP-documented parameters.
| # | Tool | Purpose |
|---|---|---|
| 1 | | List open orders. |
| 2 | | Query order history list (filled/cancelled). |
| 3 | | List current positions. |
| 4 | | List historical positions/settlements. |
| 5 | | Query TradFi category list. |
| 6 | | List symbols (by category if supported). |
| 7 | | Get ticker(s) for symbol(s). |
| 8 | | Get symbol config (required before place order: leverages, min_order_volume, step_order_volume). If no result, symbol may not exist — do not place order. |
| 9 | | Get kline/candlestick for symbol. |
| 10 | | Get user account/balance (assets). |
| 11 | | Get MT5 account info. |
Trading (write) — exact tool names and parameters must match the Gate TradFi MCP tool definition. Conditions and value limits (required/optional, ranges, allowed symbols) must be declared in the skill and in each reference; do not pass undocumented parameters.
| # | Tool (name per MCP) | Purpose |
|---|---|---|
| 12 | | Place new order; supports take-profit/stop-loss. Before calling: use |
| 13 | | Amend order price, take-profit, stop-loss only (size not supported). |
| 14 | | Cancel/delete one order. Does not support batch; one order per call. |
| 15 | | Modify position take-profit/stop-loss price only (leverage, margin not supported). |
| 16 | | Close position (full or partial). Full close: position identifier only, do not pass size/close_volume. |
查询(只读) — 仅使用MCP文档中规定的参数。
| 序号 | 工具 | 用途 |
|---|---|---|
| 1 | | 查询未平仓订单列表。 |
| 2 | | 查询订单历史列表(已成交/已取消)。 |
| 3 | | 查询当前持仓列表。 |
| 4 | | 查询历史持仓/结算记录列表。 |
| 5 | | 查询TradFi品类列表。 |
| 6 | | 查询交易对列表(支持按品类筛选)。 |
| 7 | | 获取交易对的行情报价。 |
| 8 | | 获取交易对配置信息(下单前必填:杠杆、最小下单量、下单量步长)。若无结果,表明该交易对不存在——请勿下单。 |
| 9 | | 获取交易对的K线/蜡烛图数据。 |
| 10 | | 获取用户账户/余额(资产)信息。 |
| 11 | | 获取MT5账户信息。 |
交易(写入) — 必须严格匹配Gate TradFi MCP工具定义中的工具名称和参数。必须在Skill及每个参考文档中声明条件和值限制(必填/可选参数、范围、允许的交易对);请勿传递未文档化的参数。
| 序号 | 工具(MCP规定名称) | 用途 |
|---|---|---|
| 12 | | 创建新订单;支持设置止盈/止损。调用前:使用 |
| 13 | | 仅修改订单价格、止盈、止损(不支持修改订单规模)。 |
| 14 | | 取消/删除单个订单。不支持批量操作;每次调用仅处理一个订单。 |
| 15 | | 仅修改持仓的止盈/止损价格(不支持修改杠杆、保证金)。 |
| 16 | | 平仓(全部或部分)。全部平仓:仅传递持仓标识符,无需传递规模/平仓量。 |
Parameter conditions and limits
参数条件与限制
- For each MCP tool, input conditions and limits (required/optional parameters, value ranges, allowed symbols, precision) are defined in the MCP. This skill and each reference document must declare those conditions and limits so the agent and user know what can be sent.
- In each trading reference (,
place-order.md,amend-order.md,cancel-order.md,modify-position.md), include a Parameters section that states: required/optional params, value constraints, and any MCP-specific rules. Do not add parameters that the MCP does not document.close-position.md - If the user provides a value outside allowed range or a missing required param, ask for correction before building the confirmation payload.
- 每个MCP工具的输入条件与限制(必填/可选参数、值范围、允许的交易对、精度)均在MCP中定义。本Skill及每个参考文档必须声明这些条件与限制,以便Agent和用户了解可传递的参数。
- 在每个交易参考文档(、
place-order.md、amend-order.md、cancel-order.md、modify-position.md)中,需包含参数部分,说明:必填/可选参数、值约束,以及任何MCP特定规则。请勿添加MCP未文档化的参数。close-position.md - 如果用户提供的值超出允许范围或缺少必填参数,请在构建确认请求前要求用户更正。
User confirmation (trading only)
用户确认(仅交易操作)
- Before calling any trading MCP tool (place order, amend order, cancel order, modify position, close position): output all parameters that will be sent to the MCP so the user can review them. Ask the user to confirm (e.g. "Confirm: place order with symbol=X, side=Y, size=Z, price=W. Reply yes to execute."). Do not call the tool until the user explicitly confirms.
- This applies to every write operation; query-only flows do not require confirmation.
- 在调用任何交易类MCP工具(下单、修改订单、取消订单、调整持仓、平仓)之前:输出所有将发送至MCP的参数供用户审核。请用户确认(例如:“确认:下单交易对=X,方向=Y,规模=Z,价格=W。回复yes以执行。”)。在用户明确确认前,请勿调用工具。
- 此规则适用于所有写入操作;仅查询流程无需确认。
Response parameter explanation (trading only)
响应参数说明(仅交易操作)
- After the trading MCP tool returns: in the response to the user, explain the parameters that were used (e.g. symbol, side, size, price, order_id, or position identifier) and the outcome (e.g. order created, order amended, order cancelled, position modified, position closed). Include a short summary table or list of the sent parameters and the result (success or error code/message). This is declared in this skill so the agent always reports back what was sent and what happened.
- 在交易类MCP工具返回结果之后:在给用户的响应中,说明所使用的参数(例如:交易对、方向、规模、价格、订单ID或持仓标识符)以及操作结果(例如:订单已创建、订单已修改、订单已取消、持仓已调整、持仓已平仓)。包含一个简短的汇总表格或列表,列出发送的参数和结果(成功或错误代码/消息)。本Skill中声明此规则,以便Agent始终向用户反馈发送的内容和操作结果。
Execution
执行流程
1. Intent and parameters
1. 意图与参数
- Determine module: Query (orders, positions, market, assets) or Trading (place, amend, cancel, modify position, close).
- For each MCP tool call, use only the parameters defined in the Gate TradFi MCP tool definition. Do not pass parameters that are not documented in the MCP.
- Extract from user message only those keys that the MCP actually supports. Respect conditions and limits declared in the skill and in the reference.
- 确定模块:查询(订单、持仓、市场、资产)或交易(下单、修改、取消、调整持仓、平仓)。
- 每次调用MCP工具时,仅使用Gate TradFi MCP工具定义中规定的参数。请勿传递MCP未文档化的参数。
- 仅从用户消息中提取MCP实际支持的键。遵守Skill和参考文档中声明的条件与限制。
2. Read sub-module and call tools
2. 读取子模块并调用工具
- Load the corresponding reference under and follow its Workflow.
references/ - Query: Call query tools with extracted/prompted parameters; no confirmation needed.
- Trading: Build the parameter set per the reference and MCP; output parameters for user confirmation; only after user confirms, call the trading MCP tool; then in the response, explain the parameters used and the outcome.
- 加载下对应的参考文档并遵循其工作流程。
references/ - 查询:使用提取/询问得到的参数调用查询工具;无需确认。
- 交易:根据参考文档和MCP构建参数集;输出参数供用户确认;仅在用户确认后,调用交易类MCP工具;然后在响应中说明使用的参数和操作结果。
3. Report
3. 结果反馈
- Query: Use the sub-module Report Template (tables for orders/positions/tickers, assets).
- Trading: Use the reference Report Template; include parameter summary (what was sent) and result (success or error).
- 查询:使用子模块的报告模板(订单/持仓/行情报价/资产表格)。
- 交易:使用参考文档的报告模板;包含参数汇总(发送的内容)和结果(成功或错误)。
Domain Knowledge
领域知识
- TradFi: Gate’s traditional finance product set (e.g. FX, MT5). Symbols and categories are product-specific.
- Query: Orders, positions, market, assets — use only MCP-documented parameters.
- Trading: Place/amend/cancel orders and modify/close positions — use only MCP-documented tools and parameters; declare conditions/limits; require user confirmation before execution; explain parameters and outcome in the response.
- Order id for cancel/amend: The order id used by and
cex_tradfi_delete_ordermust come fromcex_tradfi_update_order. Do not use thecex_tradfi_query_order_listoridreturned bylog_idfor cancel or amend.cex_tradfi_create_tradfi_order
- TradFi:Gate的传统金融产品集合(例如:外汇、MT5)。交易对和品类是产品特定的。
- 查询:订单、持仓、市场、资产——仅使用MCP文档化的参数。
- 交易:下单/修改/取消订单、调整/平仓持仓——仅使用MCP文档化的工具和参数;声明条件/限制;执行前需用户确认;响应中需说明使用的参数和结果。
- 取消/修改订单的订单ID:和
cex_tradfi_delete_order所使用的订单ID必须来自cex_tradfi_update_order。请勿使用cex_tradfi_query_order_list返回的cex_tradfi_create_tradfi_order或id进行取消或修改操作。log_id
Error Handling
错误处理
| Situation | Action |
|---|---|
| Tool not found / 4xx/5xx | Tell user the TradFi service or tool may be unavailable; suggest retry or check Gate MCP configuration. |
| Empty list | Report "No open orders" / "No positions" / "No symbols" etc., and do not assume error. |
| Invalid symbol / order not found | Report "Order not found" or "Symbol not found" and suggest checking symbol list. |
| Auth / permission error | Do not expose credentials; ask user to check API key or MCP auth for TradFi. |
| Trading error (e.g. insufficient margin, invalid price) | Show the error message; in the response, restate the parameters that were sent and suggest correction. |
| 场景 | 操作 |
|---|---|
| 工具未找到 / 4xx/5xx错误 | 告知用户TradFi服务或工具可能不可用;建议重试或检查Gate MCP配置。 |
| 空列表 | 反馈“无未平仓订单”/“无持仓”/“无交易对”等,请勿视为错误。 |
| 无效交易对 / 未找到订单 | 反馈“未找到订单”或“未找到交易对”,建议用户查看交易对列表。 |
| 授权 / 权限错误 | 请勿暴露凭证;请用户检查API密钥或TradFi的MCP授权。 |
| 交易错误(例如:保证金不足、价格无效) | 显示错误消息;在响应中重述发送的参数并建议用户更正。 |
Safety Rules
安全规则
- Query: No confirmation required; display data after tool success.
- Trading: Always output parameters for user confirmation before calling place/amend/cancel/modify/close; never execute a write operation without explicit user confirmation. After execution, always explain in the response the parameters that were used and the outcome.
- Sensitive data: Do not log or store credentials or balances; display only in the current response.
- 查询:无需确认;工具调用成功后展示数据。
- 交易:在调用下单/修改/取消/调整/平仓工具之前,始终输出参数供用户确认;绝不在无用户明确确认的情况下执行写入操作。执行后,始终在响应中说明使用的参数和操作结果。
- 敏感数据:请勿记录或存储凭证或余额;仅在当前响应中展示。
Report Template
报告模板
Query — After each query:
- Orders: Table with columns such as symbol, side, size, price, status, time (from list response).
- Positions: Table with position fields (e.g. symbol, side, size, entry, margin) or "No open positions."
- Market: Category list; symbol list; ticker table (symbol, last, 24h change, volume); or symbol kline summary (interval, range, OHLC).
- Assets: List of assets and balances; or MT5 account/server/balance/equity table; or "Unable to load" on error.
Trading — After each place/amend/cancel/modify/close:
- Parameters used: List or table of the parameters sent to the MCP (e.g. symbol, side, size, price, order_id).
- Result: Success (e.g. order id, status) or error (code/message). Suggest next step if error.
查询 — 每次查询后:
- 订单:表格包含交易对、方向、规模、价格、状态、时间(来自列表响应)等列。
- 持仓:持仓字段表格(例如:交易对、方向、规模、入场价、保证金)或“无未平仓持仓”。
- 市场:品类列表;交易对列表;行情报价表格(交易对、最新价、24h涨跌幅、成交量);或交易对K线汇总(时间间隔、范围、开盘价/最高价/最低价/收盘价)。
- 资产:资产与余额列表;或MT5账户/服务器/余额/净值表格;或错误时显示“无法加载”。
交易 — 每次下单/修改/取消/调整/平仓后:
- 使用的参数:发送至MCP的参数列表或表格(例如:交易对、方向、规模、价格、订单ID)。
- 结果:成功(例如:订单ID、状态)或错误(代码/消息)。若出错,建议下一步操作。