1---2name: gate-exchange-crossex3description: Use this skill for Gate CrossEx cross-exchange operations: order placement, transfer, convert, and order/position/history queries across Gate, Binance, OKX and Bybit. Trigger phrases include "buy spot", "transfer", "convert", "query positions", "order history".4---56# Gate CrossEx Trading Suite78This skill is the unified entry point for Gate CrossEx cross-exchange trading. It supports lots of **core operations**:9order management, position query, and history query. User intents are routed to corresponding workflows.1011## General Rules1213⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.14Do NOT select or call any tool until all rules are read. These rules have the highest priority.15→ Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)16- **Only call MCP tools explicitly listed in this skill.** Tools not documented here must NOT be called, even if they17 exist in the MCP server.181920---2122## MCP Dependencies2324### Required MCP Servers25| MCP Server | Status |26|------------|--------|27| Gate (main) | ✅ Required |2829### MCP Tools Used3031**Query Operations (Read-only)**3233- cex_crx_get_crx_account34- cex_crx_get_crx_fee35- cex_crx_get_crx_interest_rate36- cex_crx_get_crx_margin_positions_leverage37- cex_crx_get_crx_order38- cex_crx_get_crx_positions_leverage39- cex_crx_list_crx_account_book40- cex_crx_list_crx_adl_rank41- cex_crx_list_crx_coin_discount_rate42- cex_crx_list_crx_history_margin_interests43- cex_crx_list_crx_history_margin_positions44- cex_crx_list_crx_history_orders45- cex_crx_list_crx_history_positions46- cex_crx_list_crx_history_trades47- cex_crx_list_crx_margin_positions48- cex_crx_list_crx_open_orders49- cex_crx_list_crx_positions50- cex_crx_list_crx_rule_risk_limits51- cex_crx_list_crx_rule_symbols52- cex_crx_list_crx_transfer_coins53- cex_crx_list_crx_transfers5455**Execution Operations (Write)**5657- cex_crx_cancel_crx_order58- cex_crx_close_crx_position59- cex_crx_create_crx_convert_order60- cex_crx_create_crx_convert_quote61- cex_crx_create_crx_order62- cex_crx_create_crx_transfer63- cex_crx_update_crx_account64- cex_crx_update_crx_margin_positions_leverage65- cex_crx_update_crx_order66- cex_crx_update_crx_positions_leverage6768### Authentication69- API Key Required: Yes (see skill doc/runtime MCP deployment)70- Permissions: Crx:Write71- Get API Key: https://www.gate.io/myaccount/profile/api-key/manage7273### Installation Check74- Required: Gate (main)75- Install: Run installer skill for your IDE76 - Cursor: `gate-mcp-cursor-installer`77 - Codex: `gate-mcp-codex-installer`78 - Claude: `gate-mcp-claude-installer`79 - OpenClaw: `gate-mcp-openclaw-installer`8081## Module Overview8283| Module | Description | Trigger Keywords |84|---------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------|85| **Spot** | Limit/market buy/sell, cross-exchange arbitrage | `spot buy`, `spot sell`, `buy spot`, `sell spot` |86| **Margin** | Long/short trading, margin management, auto-borrowing | `margin long`, `margin short`, `long margin`, `short margin` |87| **Futures** | USDT perpetual contracts, dual-direction positions, leverage adjustment | `futures long`, `futures short`, `open long`, `open short` |88| **Transfer** | Cross-exchange fund transfer | `fund transfer`, `cross-exchange transfer`, `transfer`, `move funds` |89| **Convert** | Flash convert and conversion quote workflow | `convert trading`, `flash convert`, `convert`, `quote convert` |90| **Orders** | Query, cancel, amend orders, order history | `query orders`, `cancel order`, `amend order`, `order history`, `list orders` |91| **Positions** | Query all position types, history records | `query positions`, `check positions`, `position history`, `positions` |92| **History** | Query order/position/trade/interest history | `history query`, `trade history`, `interest history`, `history` |9394## Routing Rules9596| Intent | Example Phrases | Route To |97|-----------------------------|----------------------------------------------------------------------------------------------|---------------------------------------------|98| **Spot Trading** | "Buy 100 USDT worth of BTC", "Sell 0.5 BTC", "Market buy ETH spot" | Read `references/spot-trading.md` |99| **Margin Trading** | "Long 50 USDT worth of XRP on margin", "Short BTC on margin", "10x leverage long" | Read `references/margin-trading.md` |100| **Futures Trading** | "Open 1 BTC futures long position", "Market short ETH", "Adjust leverage to 20x" | Read `references/futures-trading.md` |101| **Cross-Exchange Transfer** | "Transfer 100 USDT from Gate to Binance", "Move ETH from OKX to Gate" | Read `references/transfer.md` |102| **Convert Trading** | "Flash convert 10 USDT to BTC", "Convert 50 USDT to ETH on Gate" | Read `references/convert-trading.md` |103| **Order Management** | "Query all open orders", "Cancel that buy order", "Amend order price", "Query order history" | Read `references/order-management.md` |104| **Position Query** | "Query all my positions", "Show futures positions", "Position history" | Read `references/position-query.md` |105| **History Query** | "Query trade history", "Position history", "Margin interest history", "Account ledger" | Read `references/history-query.md` |106| **Unclear** | "Show account" , "Help me" , "Please Check my account" | **Clarify**: Query account, then guide user |107108## MCP Tools109110This skill uses the **CrossEx MCP toolset** with the cex_crx prefix as its only core tool family.111112**Scope rule**: Only execute operations explicitly documented in this skill. Only call tools listed in the tables below113or in `references/*.md`. Tools or operations not mentioned here must not be called.114115### Tool Naming Convention116117- List operations in the cex_crx family query symbols, orders, positions, transfers, or history118- Get operations in the cex_crx family query a single account setting, fee, rate, or order detail119- Create operations in the cex_crx family create an order, transfer, convert quote, or convert order120- Update operations in the cex_crx family update account settings, leverage, or existing orders121- Cancel operations in the cex_crx family cancel an existing order122- Close operations in the cex_crx family close an existing position123124### Symbol And Rule Tools125126| Tool | Purpose |127|---------------------------------------|--------------------------------------------|128| `cex_crx_list_crx_rule_symbols` | List supported CrossEx trading symbols |129| `cex_crx_list_crx_rule_risk_limits` | Query symbol risk limit rules |130| `cex_crx_list_crx_transfer_coins` | List assets supported for CrossEx transfer |131| `cex_crx_get_crx_fee` | Query CrossEx trading fee information |132| `cex_crx_get_crx_interest_rate` | Query CrossEx interest rates |133| `cex_crx_list_crx_coin_discount_rate` | Query collateral discount rates |134135### Account Tools136137| Tool | Purpose |138|---------------------------------|---------------------------------------------|139| `cex_crx_get_crx_account` | Query CrossEx account overview and balances |140| `cex_crx_update_crx_account` | Update CrossEx account settings |141| `cex_crx_list_crx_account_book` | Query CrossEx account ledger entries |142143### Transfer And Convert Tools144145| Tool | Purpose |146|------------------------------------|----------------------------------|147| `cex_crx_list_crx_transfers` | Query transfer history |148| `cex_crx_create_crx_transfer` | Create a cross-exchange transfer |149| `cex_crx_create_crx_convert_quote` | Get a flash convert quote |150| `cex_crx_create_crx_convert_order` | Execute a flash convert order |151152### Order Tools153154| Tool | Purpose |155|-----------------------------------|---------------------------|156| `cex_crx_list_crx_open_orders` | Query current open orders |157| `cex_crx_create_crx_order` | Create a CrossEx order |158| `cex_crx_get_crx_order` | Query order details |159| `cex_crx_update_crx_order` | Amend an existing order |160| `cex_crx_cancel_crx_order` | Cancel a single order |161| `cex_crx_list_crx_history_orders` | Query order history |162| `cex_crx_list_crx_history_trades` | Query trade history |163164### Position And Leverage Tools165166| Tool | Purpose |167|------------------------------------------------|------------------------------------|168| `cex_crx_list_crx_positions` | Query current futures positions |169| `cex_crx_list_crx_margin_positions` | Query current margin positions |170| `cex_crx_close_crx_position` | Close an existing CrossEx position |171| `cex_crx_get_crx_positions_leverage` | Query futures leverage settings |172| `cex_crx_update_crx_positions_leverage` | Update futures leverage |173| `cex_crx_get_crx_margin_positions_leverage` | Query margin leverage settings |174| `cex_crx_update_crx_margin_positions_leverage` | Update margin leverage |175| `cex_crx_list_crx_history_positions` | Query futures position history |176| `cex_crx_list_crx_history_margin_positions` | Query margin position history |177| `cex_crx_list_crx_history_margin_interests` | Query margin interest history |178| `cex_crx_list_crx_adl_rank` | Query ADL rank information |179180### Usage Guidance181182- Use the cex_crx MCP family as the default and only core MCP family for this skill.183- Use list/get tools to query symbol rules, fees, balances, leverage, or supported assets.184- Prefer history and account-book tools when the user asks for records, audit trails, or status verification.185186## Execution187188### 1. Intent and Parameter Identification189190- Determine module (orders/positions/history)191- Extract key parameters:192 - **Trading Pair**: `GATE_SPOT_BTC_USDT`, `GATE_MARGIN_XRP_USDT`, `GATE_FUTURE_ETH_USDT`193 - **Exchange**: `GATE`, `BINANCE`, `OKX`, `BYBIT`194 - **Direction**: `BUY` (buy/long), `SELL` (sell/short)195 - **Quantity**: USDT amount, coin quantity, contract size196 - **Price**: Limit, market197 - **Leverage**: Leverage multiplier (margin/futures only)198 - **Position Side**: `LONG` (long), `SHORT` (short, margin/futures only)199- **Missing Parameters**: If required parameters are missing, ask user200201### 2. Pre-checks202203- **Trading Pair**: Call `cex_crx_list_crx_rule_symbols` to verify204- **Account Balance**: Call `cex_crx_get_crx_account` to check if available margin is sufficient205- **Position Check**:206 - Margin Trading: Check existing positions to avoid direction conflicts207 - Futures Trading: Check dual-direction position mode208- **Minimum Amount**: Query `min_quote_amount` (typically 3 USDT)209- **Exchange Status**: Verify target exchange is operating normally210211### 3. Module Logic212213#### Module A: Spot Trading2142151. **Parameter Confirmation**:216 - Trading pair format: `GATE_SPOT_{BASE}_{QUOTE}`217 - Buy parameters: `quote_qty` (USDT amount)218 - Sell parameters: `qty` (coin quantity)2192. **Minimum Amount Check**: Call `cex_crx_list_crx_rule_symbols` to query minimum amount2203. **Pre-order Confirmation**: Display order summary (pair, direction, quantity, price), require user confirmation2214. **Place Order**: Call `cex_crx_create_crx_order`2225. **Verification**: Call `cex_crx_get_crx_order` to confirm order status223224#### Module B: Margin Trading2252261. **Parameter Confirmation**:227 - Trading pair format: `GATE_MARGIN_{BASE}_{QUOTE}`228 - Required parameters: `qty` (coin quantity), `position_side` (`LONG` or `SHORT`)229 - Optional parameters: `quote_qty` (USDT amount)2302. **Leverage Check**: Query current leverage, adjust if user specifies2313. **Position Direction**:232 - Long (`LONG`): Buy coin, borrow USDT233 - Short (`SHORT`): Sell coin, borrow coin2344. **Minimum Amount Check**: Call `cex_crx_list_crx_rule_symbols` to query minimum amount2355. **Pre-order Confirmation**: Display order summary (pair, direction, quantity, leverage), require confirmation2366. **Place Order**: Call `cex_crx_create_crx_order` with parameter `position_side`2377. **Verification**: Call `cex_crx_list_crx_margin_positions` with a `symbol` filter to confirm position238239#### Module C: Futures Trading2402411. **Parameter Confirmation**:242 - Trading pair format: `GATE_FUTURE_{BASE}_{QUOTE}`243 - Required parameters: `qty` (contract size), `position_side` (`LONG` or `SHORT`)2442. **Leverage Adjustment**: If user specifies leverage, call `cex_crx_get_crx_positions_leverage` and245 `cex_crx_update_crx_positions_leverage`2463. **Contract Size Calculation** (if ordering by value):247 - Get `quanto_multiplier` and current price248 - Round down to ensure overspending is avoided2494. **Minimum Size Check**: Call `cex_crx_list_crx_rule_symbols` to query minimum size2505. **Pre-order Confirmation**: Display order summary (pair, direction, size, leverage), require confirmation2516. **Place Order**: Call `cex_crx_create_crx_order` with parameter `position_side`2527. **Verification**: Call `cex_crx_list_crx_positions` with a `symbol` filter to confirm position253254#### Module D: Cross-Exchange Transfer2552561. **Transfer Type**:257 - Cross-exchange transfer: `cex_crx_create_crx_transfer` (Exchange A -> Exchange B)2582. **Parameter Confirmation**:259 - Cross-exchange transfer: `from`, `to`, `coin`, `amount`260 - **From/To Account Rules**:261 | Coin | Mode | Valid `from` / `to` | Defaults |262 |------|------|--------------------|---------|263 | USDT | Cross-Exchange | `SPOT` ↔ `CROSSEX` | `CROSSEX_{exchange_type}` → `CROSSEX` |264 | USDT | Sub-Exchange | `SPOT` ↔ `CROSSEX_{exchange_type}` or `CROSSEX_{exchange_type}` ↔ `CROSSEX_{exchange_type}` | `CROSSEX` → `CROSSEX_GATE` |265 | Non-USDT | Any | Must use `CROSSEX_{exchange_type}` (never `CROSSEX` alone). Cross-exchange transfers allowed (e.g., `CROSSEX_BINANCE` ↔ `CROSSEX_GATE`). | — |2663. **Supported Coin Check**: Call `cex_crx_list_crx_transfer_coins` to verify2674. **Balance Check**: Confirm source account has sufficient balance2685. **Pre-transfer Confirmation**: Display transfer summary (source, destination, coin, quantity), require confirmation2696. **Execute Transfer**: Call `cex_crx_create_crx_transfer`2707. **Verification**: Call `cex_crx_list_crx_transfers` to query transfer history and confirm271272#### Module E: Convert Trading2732741. **Convert Type**:275 - Flash convert quote: `cex_crx_create_crx_convert_quote`276 - Flash convert execution: `cex_crx_create_crx_convert_order`2772. **Parameter Confirmation**:278 - Flash convert: `from_coin`, `to_coin`, `from_amount`, `exchange_type`2793. **Balance Check**: Confirm source account has sufficient balance for the convert pair2804. **Pre-convert Confirmation**: Display source asset, target asset, rate, and expected receive amount, then require281 confirmation2825. **Quote**: Call `cex_crx_create_crx_convert_quote`2836. **Execute Convert**: Call `cex_crx_create_crx_convert_order` with the returned `quote_id`2847. **Verification**: Call `cex_crx_get_crx_account` to confirm resulting balances285286#### Module F: Order Management2872881. **Query Orders**:289 - Current open orders: Call `cex_crx_list_crx_open_orders`290 - Order details: Call `cex_crx_get_crx_order`291 - **Order History**: Call `cex_crx_list_crx_history_orders` (parameters: limit, page, from, to)2922. **Cancel Orders**:293 - Single cancel: Call `cex_crx_cancel_crx_order`2943. **Amend Orders**:295 - Check order status must be `open`296 - Call `cex_crx_update_crx_order` to amend price or quantity2974. **Display Results**: Display order information in table format298299#### Module G: Position Query3003011. **Query Types**:302 - Futures positions: Call `cex_crx_list_crx_positions`303 - Margin positions: Call `cex_crx_list_crx_margin_positions`304 - Futures leverage: Call `cex_crx_get_crx_positions_leverage`305 - Margin leverage: Call `cex_crx_get_crx_margin_positions_leverage`3062. **History Query**:307 - **Position History**: Call `cex_crx_list_crx_history_positions` (parameters: limit, page, from, to)308 - **Margin Position History**: Call `cex_crx_list_crx_history_margin_positions`309 - **Trade History**: Call `cex_crx_list_crx_history_trades` (parameters: limit, page, from, to)3103. **Display Format**:311 - Current positions: Table format (pair, direction, quantity, entry price, unrealized PnL)312 - History records: Reverse chronological order, display recent N records313314#### Module H: History Query3153161. **Order History**:317 - Call `cex_crx_list_crx_history_orders`318 - Parameters: `limit` (max 100), `page`, `from` (start timestamp), `to` (end timestamp)3192. **Trade History**:320 - Call `cex_crx_list_crx_history_trades`321 - Same parameters as above3223. **Position History**:323 - Call `cex_crx_list_crx_history_positions`324 - Same parameters as above3254. **Margin Position History**:326 - Call `cex_crx_list_crx_history_margin_positions`327 - Same parameters as above3285. **Margin Interest History**:329 - Call `cex_crx_list_crx_history_margin_interests`330 - Same parameters as above331332## Report Template333334After each operation, output a concise standardized result.335336## Safety Rules337338- **Credentials**: Never prompt or induce the user to paste API Secret Key into chat; prefer secure local MCP configuration.339- **User-to-User Transfer**: This skill does not support P2P or user-to-user transfers; only transfers between the user's own accounts (e.g., SPOT ↔ CROSSEX) are allowed.340- **Trade Orders**: Display complete order summary (pair, direction, quantity, price, leverage), require user341 confirmation before placing order342- **Cross-Exchange Transfer**: Display transfer details (source, destination, quantity, arrival time), require343 confirmation344- **Scope rule**: Only call tools documented in this skill. If the user requests an operation not documented here,345 respond that it is not supported by this skill.346- **Batch Operations**: Display operation scope and impact, require explicit confirmation347348Example: *"Reply 'confirm' to execute the above operation."*349350## Error Handling351352| Error Code | Handling |353|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|354| `USER_NOT_EXIST` | Please confirm if a GATE CrossEx account has been opened. Refer to the GATE Help Center -> CrossEx Trading -> CrossEx Account Operation Guide for instructions. |355| `TRADE_INVALID_QUOTE_ORDER_QTY` | ⚠️ Incorrect parameter name: Market buy must use `quote_qty` |356| `TRADE_INVALID_ORDER_QTY` | ⚠️ Limit order error: Limit orders must use `qty` (coin quantity) + `price` |357| `TRADE_ORDER_AMOUNT_MIN_ERROR` | Order amount below minimum notional value (typically 3 USDT), increase quantity or amount |358| `CONVERT_TRADE_QUOTE_EXCHANGE_INVALID_ERROR` | ⚠️ Flash convert: `exchange_type` parameter value must be uppercase exchange code (e.g., `GATE`) |359| `TRADE_MARGIN_INVALID_PZ_SIDE_ERROR` | Prompt that margin/futures trading must specify `position_side` (LONG/SHORT) |360| `BALANCE_NOT_ENOUGH` | Insufficient available margin, suggest reducing trade amount or depositing |361| `SYMBOL_NOT_FOUND` | Confirm trading pair format is correct (e.g., GATE_SPOT_BTC_USDT) |362| `INVALID_PARAM_VALUE` | Check parameter format (qty is numeric string, position_side is LONG/SHORT) |363| `POSITION_NOT_EMPTY` | Prompt to close position before reversing direction |364| `TRADE_ORDER_LOT_SIZE_ERROR` | Suggest adjusting quantity to minimum unit of the trading pair |365| `RATE_LIMIT_EXCEEDED` | Prompt user about rate limit; suggest retrying later or reducing request frequency |366| `TRADE_INVALID_EXCHANGE_TYPE` | Invalid exchange type; please check the `exchange_type` parameter (e.g., GATE, BINANCE, OKX, BYBIT) |