Gate Spot Trading 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 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.
MCP Dependencies
Required MCP Servers
| MCP Server |
Status |
| Gate (main) |
✅ Required |
MCP Tools Used
Query Operations (Read-only)
- cex_spot_get_currency
- cex_spot_get_currency_pair
- cex_spot_get_spot_accounts
- cex_spot_get_spot_batch_fee
- cex_spot_get_spot_candlesticks
- cex_spot_get_spot_order_book
- cex_spot_get_spot_price_triggered_order
- cex_spot_get_spot_tickers
- cex_spot_list_spot_account_book
- cex_spot_list_spot_my_trades
- cex_spot_list_spot_orders
- cex_spot_list_spot_price_triggered_orders
- cex_wallet_get_wallet_fee
Execution Operations (Write)
- cex_spot_amend_spot_batch_orders
- cex_spot_amend_spot_order
- cex_spot_cancel_all_spot_orders
- cex_spot_cancel_spot_batch_orders
- cex_spot_cancel_spot_order
- cex_spot_cancel_spot_price_triggered_order
- cex_spot_cancel_spot_price_triggered_order_list
- cex_spot_create_spot_batch_orders
- cex_spot_create_spot_order
- cex_spot_create_spot_price_triggered_order
Authentication
Installation Check
- Required: Gate (main)
- Install: Run installer skill for your IDE
- Cursor:
gate-mcp-cursor-installer
- Codex:
gate-mcp-codex-installer
- Claude:
gate-mcp-claude-installer
- OpenClaw:
gate-mcp-openclaw-installer
Domain Knowledge
Tool Mapping by Domain
| Group |
Tool Calls (jsonrpc: call.method) |
| Account and balances |
cex_spot_get_spot_accounts, cex_spot_list_spot_account_book |
| Place/cancel/amend orders |
cex_spot_create_spot_order, cex_spot_create_spot_batch_orders, cex_spot_cancel_all_spot_orders, cex_spot_cancel_spot_order, cex_spot_cancel_spot_batch_orders, cex_spot_amend_spot_order, cex_spot_amend_spot_batch_orders |
| Trigger orders (price orders) |
cex_spot_create_spot_price_triggered_order, cex_spot_list_spot_price_triggered_orders, cex_spot_get_spot_price_triggered_order, cex_spot_cancel_spot_price_triggered_order, cex_spot_cancel_spot_price_triggered_order_list |
| Open orders and fills |
cex_spot_list_spot_orders, cex_spot_list_spot_my_trades |
| Market data |
cex_spot_get_spot_tickers, cex_spot_get_spot_order_book, cex_spot_get_spot_candlesticks |
| Trading rules |
cex_spot_get_currency, cex_spot_get_currency_pair |
| Fees |
cex_wallet_get_wallet_fee, cex_spot_get_spot_batch_fee |
Key Trading Rules
- Use
BASE_QUOTE format for trading pairs, for example BTC_USDT.
- Check quote-currency balance first before buy orders (for example USDT).
- Amount-based buys must satisfy
min_quote_amount (commonly 10U).
- Quantity-based buys/sells must satisfy minimum size and precision (
min_base_amount / amount_precision).
- Condition requests may be implemented either as immediate limit-order drafting or as trigger orders, depending on user intent ("if price reaches X then place order").
- Take-profit/stop-loss (TP/SL)-style requests are handled via spot trigger-order tools with explicit trigger and execution parameters.
Market Order Parameter Extraction Rules (Mandatory)
When calling cex_spot_create_spot_order with type=market, fill amount by side:
| side |
amount meaning |
Example |
buy |
Quote-currency amount (USDT) |
"Buy 100U BTC" -> amount="100" |
sell |
Base-currency quantity (BTC/ETH, etc.) |
"Sell 0.01 BTC" -> amount="0.01" |
Pre-check before execution:
buy market order: verify quote-currency balance can cover amount (USDT).
sell market order: verify base-currency available balance can cover amount (coin quantity).
Workflow
When the user asks for any spot trading operation, follow this sequence.
Step 1: Identify Task Type
Classify the request into one of these six categories:
- Buy (market/limit/full-balance buy)
- Sell (full-position sell/conditional sell)
- Account query (total assets, balance checks, tradability checks)
- Order management (list open orders, amend, cancel)
- Post-trade verification (filled or not, credited amount, current holdings)
- Combined actions (sell then buy, buy then place sell order, trend-based buy)
Step 2: Extract Parameters and Run Pre-checks
Extract key fields:
currency / currency_pair
side (buy/sell)
amount (coin quantity) or quote_amount (USDT amount)
price or price condition (for example "2% below current")
- trigger condition (execute only when condition is met)
When type=market, normalize parameters as:
side=buy: amount = quote_amount (USDT amount)
side=sell: amount = base_amount (base-coin quantity)
Pre-check order:
- Trading pair/currency tradability status
- Minimum order amount/size and precision
- Available balance sufficiency
- User condition satisfaction (for example "buy only below 60000")
Step 3: Final User Confirmation Before Any Order Placement (Mandatory)
Before every cex_spot_create_spot_order, cex_spot_create_spot_batch_orders, or cex_spot_create_spot_price_triggered_order, always provide an Order Draft first, then wait for explicit confirmation.
Required execution flow:
- Send order draft (no trading call yet)
- Wait for explicit user approval
- Only after approval, submit the real order
- Without approval, perform query/estimation only, never execute trading
- Treat confirmation as single-use: after one execution, request confirmation again for any next order
Required confirmation fields:
- trading pair (
currency_pair)
- side and order type (
buy/sell, market/limit)
amount meaning and value
- limit price (if applicable) or pricing basis
- estimated fill / estimated cost or proceeds
- main risk note (for example slippage)
Recommended draft wording:
Order Draft: BTC_USDT, buy, market, amount=100 USDT, estimated fill around current ask, risk: slippage in fast markets. Reply "Confirm order" to place it.
Allowed confirmation responses (examples):
Confirm order, Confirm, Proceed, Yes, place it
Hard blocking rules (non-bypassable):
- NEVER call
cex_spot_create_spot_order, cex_spot_create_spot_batch_orders, or cex_spot_create_spot_price_triggered_order unless the user explicitly confirms in the immediately previous turn.
- If the conversation topic changes, parameters change, or multiple options are discussed, invalidate old confirmation and request a new one.
- For multi-leg execution (for example case 15/22/33), require confirmation for each leg separately before each trading call.
If user confirmation is missing, ambiguous, or negative:
- do not place the order
- return a pending status and ask for explicit confirmation
- continue with read-only actions only (balance checks, market quotes, fee estimation)
Step 4: Call Tools by Scenario
Use only the minimal tool set required for the task:
- Balance and available funds:
cex_spot_get_spot_accounts
- Rule validation:
cex_spot_get_currency_pair
- Live price and moves:
cex_spot_get_spot_tickers
- Order placement:
cex_spot_create_spot_order / cex_spot_create_spot_batch_orders
- Trigger-order placement/query/cancel:
cex_spot_create_spot_price_triggered_order / cex_spot_list_spot_price_triggered_orders / cex_spot_get_spot_price_triggered_order / cex_spot_cancel_spot_price_triggered_order / cex_spot_cancel_spot_price_triggered_order_list
- Cancel/amend:
cex_spot_cancel_all_spot_orders / cex_spot_cancel_spot_order / cex_spot_cancel_spot_batch_orders / cex_spot_amend_spot_order / cex_spot_amend_spot_batch_orders
- Open order query:
cex_spot_list_spot_orders (use status=open)
- Fill verification:
cex_spot_list_spot_my_trades
- Account change history:
cex_spot_list_spot_account_book
- Batch fee query:
cex_spot_get_spot_batch_fee
Step 5: Return Actionable Result and Status
The response must include:
- Whether execution succeeded (or why it did not execute)
- Core numbers (price, quantity, amount, balance change)
- If condition not met, clearly explain why no order is placed now
Case Routing Map (1-36)
A. Buy and Account Queries (1-8)
| Case |
User Intent |
Core Decision |
Tool Sequence |
| 1 |
Market buy |
Place market buy if USDT is sufficient |
cex_spot_get_spot_accounts → cex_spot_create_spot_order |
| 2 |
Buy at target price |
Create a limit buy order |
cex_spot_get_spot_accounts → cex_spot_create_spot_order |
| 3 |
Buy with all balance |
Use all available USDT balance to buy |
cex_spot_get_spot_accounts → cex_spot_create_spot_order |
| 4 |
Buy readiness check |
Currency status + min size + current unit price |
cex_spot_get_currency → cex_spot_get_currency_pair → cex_spot_get_spot_tickers |
| 5 |
Asset summary |
Convert all holdings to USDT value |
cex_spot_get_spot_accounts → cex_spot_get_spot_tickers |
| 6 |
Cancel all then check balance |
Cancel all open orders and return balances |
cex_spot_cancel_all_spot_orders → cex_spot_get_spot_accounts |
| 7 |
Sell dust |
Sell only if minimum size is met |
cex_spot_get_spot_accounts → cex_spot_get_currency_pair → cex_spot_create_spot_order |
| 8 |
Balance + minimum buy check |
Place order only if account balance and min_quote_amount are both satisfied |
cex_spot_get_spot_accounts → cex_spot_get_currency_pair → cex_spot_create_spot_order |
B. Smart Monitoring and Trading (9-16)
| Case |
User Intent |
Core Decision |
Tool Sequence |
| 9 |
Buy 2% lower |
Place limit buy at current price -2% |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 10 |
Sell at +500 |
Place limit sell at current price +500 |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 11 |
Buy near today's low |
Buy only if current price is near 24h low |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 12 |
Sell on 5% drop request |
Calculate target drop price and place sell limit order |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 13 |
Buy top gainer |
Auto-pick highest 24h gainer and buy |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 14 |
Buy larger loser |
Compare BTC/ETH daily drop and buy the bigger loser |
cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 15 |
Buy then place sell |
Market buy, then place sell at +2% reference price |
cex_spot_create_spot_order → cex_spot_create_spot_order |
| 16 |
Fee estimate |
Estimate total cost from fee rate and live price |
cex_wallet_get_wallet_fee → cex_spot_get_spot_tickers |
C. Order Management and Amendment (17-25)
| Case |
User Intent |
Core Decision |
Tool Sequence |
| 17 |
Raise price for unfilled order |
Confirm how much to raise (or target price), locate unfilled buy orders, confirm which order to amend if multiple, then amend limit price |
cex_spot_list_spot_orders(status=open) → cex_spot_amend_spot_order |
| 18 |
Verify fill and holdings |
Last buy fill quantity + current total holdings |
cex_spot_list_spot_my_trades → cex_spot_get_spot_accounts |
| 19 |
Cancel if not filled |
If still open, cancel and then recheck balance |
cex_spot_list_spot_orders(status=open) → cex_spot_cancel_spot_order → cex_spot_get_spot_accounts |
| 20 |
Rebuy at last price |
Use last fill price, check balance, then place limit buy |
cex_spot_list_spot_my_trades → cex_spot_get_spot_accounts → cex_spot_create_spot_order |
| 21 |
Sell at break-even or better |
Sell only if current price is above cost basis |
cex_spot_list_spot_my_trades → cex_spot_get_spot_tickers → cex_spot_create_spot_order |
| 22 |
Asset swap |
Estimate value, if >=10U then sell then buy |
cex_spot_get_spot_accounts → cex_spot_get_spot_tickers → cex_spot_create_spot_order(sell) → cex_spot_create_spot_order(buy) |
| 23 |
Buy if price condition met |
Buy only when current < 60000, then report balance |
cex_spot_get_spot_tickers → cex_spot_create_spot_order → cex_spot_get_spot_accounts |
| 24 |
Buy on trend condition |
Buy only if 3 of last 4 hourly candles are bullish |
cex_spot_get_spot_candlesticks → cex_spot_create_spot_order |
| 25 |
Fast-fill limit buy |
Use best opposite-book price for fast execution |
cex_spot_get_spot_order_book → cex_spot_create_spot_order |
D. Advanced Spot Utilities (26-31)
| Case |
User Intent |
Core Decision |
Tool Sequence |
| 26 |
Filter and batch-cancel selected open orders |
Verify target order ids exist in open orders, show candidate list, cancel only after user verification |
cex_spot_list_spot_orders(status=open) → cex_spot_cancel_spot_batch_orders |
| 27 |
Market slippage simulation |
Simulate average fill from order-book asks for a notional buy, compare to last price |
cex_spot_get_spot_order_book → cex_spot_get_spot_tickers |
| 28 |
Batch buy placement |
Check total required quote amount vs available balance, then place multi-order basket |
cex_spot_get_spot_accounts → cex_spot_create_spot_batch_orders |
| 29 |
Fee-rate comparison across pairs |
Compare fee tiers and translate fee impact into estimated cost |
cex_spot_get_spot_batch_fee → cex_spot_get_spot_tickers |
| 30 |
Account-book audit + current balance |
Show recent ledger changes for a coin and current remaining balance |
cex_spot_list_spot_account_book → cex_spot_get_spot_accounts |
| 31 |
Batch amend open buy orders by +1% |
Filter open orders by pair, select up to 5 target buy orders, reprice and batch amend after user verification |
cex_spot_list_spot_orders(status=open) → cex_spot_amend_spot_batch_orders |
E. Trigger Orders and TP/SL Automation (32-36)
| Case |
User Intent |
Core Decision |
Tool Sequence |
| 32 |
Conditional buy trigger order |
Read current BTC price, compute 5% drop trigger, place buy trigger after confirmation |
cex_spot_get_spot_tickers → cex_spot_create_spot_price_triggered_order |
| 33 |
Dual TP/SL trigger placement |
Check ETH available balance, build TP and SL trigger legs, confirm then place both |
cex_spot_get_spot_accounts → cex_spot_create_spot_price_triggered_order → cex_spot_create_spot_price_triggered_order |
| 34 |
Single trigger order progress query |
Read trigger-order detail and compare against live market price to compute distance to trigger |
cex_spot_get_spot_price_triggered_order → cex_spot_get_spot_tickers |
| 35 |
Batch cancel BTC buy trigger orders |
List open trigger orders, filter BTC buy side, confirm scope, then batch cancel |
cex_spot_list_spot_price_triggered_orders(status=open) → cex_spot_cancel_spot_price_triggered_order_list |
| 36 |
Single trigger/TP-SL order cancel |
Verify one target trigger order is active, then cancel after confirmation |
cex_spot_get_spot_price_triggered_order → cex_spot_cancel_spot_price_triggered_order |
Judgment Logic Summary
| Condition |
Action |
| User asks to check balance before buying |
Must call cex_spot_get_spot_accounts first; place order only if sufficient |
| User specifies buy/sell at target price |
Use type=limit at user-provided price |
| User asks for fastest fill at current market |
Prefer market; if "fast limit" is requested, use best book price |
Market buy (buy) |
Fill amount with USDT quote amount, not base quantity |
Market sell (sell) |
Fill amount with base-coin quantity, not USDT amount |
| User requests take-profit/stop-loss |
Use trigger-order workflow: validate position size, draft TP+SL legs, then place after explicit confirmation |
| Any order placement request |
Require explicit final user confirmation before cex_spot_create_spot_order |
| User has not replied with clear confirmation |
Keep order as draft; no trading execution |
| Confirmation is stale or not from the immediately previous turn |
Invalidate it and require a fresh confirmation |
| Multi-leg trading flow |
Require per-leg confirmation before each cex_spot_create_spot_order |
| User asks to amend an unfilled buy order |
Confirm price increase amount or exact target price before cex_spot_amend_spot_order |
| Multiple open buy orders match amendment request |
Ask user to choose which order to amend before executing |
| User requests selected-order batch cancellation |
Verify each order id exists/open, present list, and run cex_spot_cancel_spot_batch_orders only after user verification |
| User requests batch amend for open orders |
Filter target pair open buy orders (max 5), compute repriced levels, and run cex_spot_amend_spot_batch_orders only after user verification |
| User requests trigger-order progress |
Read one trigger order and compare current ticker price to trigger condition; return numeric distance |
| User requests trigger-order batch cancellation |
Filter trigger orders by pair+side, present cancellation scope, then call cex_spot_cancel_spot_price_triggered_order_list after confirmation |
| User requests single trigger-order cancellation |
Verify order is active/matching intent, then call cex_spot_cancel_spot_price_triggered_order after confirmation |
| User requests market slippage simulation |
Use order-book depth simulation and compare weighted fill vs ticker last price |
| User requests multi-coin one-click buy |
Validate summed quote requirement, then use cex_spot_create_spot_batch_orders |
| User requests fee comparison for multiple pairs |
Use cex_spot_get_spot_batch_fee and convert to cost impact with latest prices |
| User requests account flow for a coin |
Use cex_spot_list_spot_account_book and then reconcile with cex_spot_get_spot_accounts |
| User amount is too small |
Check min_quote_amount; if not met, ask user to increase amount |
| User requests all-in buy/sell |
Use available balance, then trim by minimum trade rules |
| Trigger condition not met |
Do not place order; return current vs target price gap |
Report Template
## Execution Result
| Item | Value |
|------|-----|
| Scenario | {case_name} |
| Pair | {currency_pair} |
| Action | {action} |
| Status | {status} |
| Key Metrics | {key_metrics} |
{decision_text}
Example decision_text:
✅ Condition met. Your order has been placed.
📝 Order draft ready. Reply "Confirm order" to execute.
⏸️ No order placed yet: current price is 60200, above your target 60000.
❌ Not executed: minimum order amount is 10U, your input is 5U.
Error Handling
| Error Type |
Typical Cause |
Handling Strategy |
| Insufficient balance |
Not enough available USDT/coins |
Return shortfall and suggest reducing order size |
| Minimum trade constraint |
Below minimum amount/size |
Return threshold and suggest increasing order size |
| Trigger-order parameter mismatch |
Trigger rule/price/side is inconsistent with user intent |
Return normalized trigger draft and require user reconfirmation |
| Missing final confirmation |
User has not clearly approved final order summary |
Keep order pending and request explicit confirmation |
| Stale confirmation |
Confirmation does not match the current draft or is not in the previous turn |
Reject execution and ask for reconfirmation |
| Draft-only mode |
User has not confirmed yet |
Only run query/estimation tools; do not call cex_spot_create_spot_order, cex_spot_create_spot_batch_orders, or cex_spot_create_spot_price_triggered_order |
| Ambiguous amendment target |
Multiple candidate open buy orders |
Keep pending and ask user to confirm order ID/row |
| Batch-cancel ambiguity |
Some requested order ids are missing/not-open |
Return matched vs unmatched ids and request reconfirmation |
| Batch-amend ambiguity |
Candidate order set is unclear or exceeds max selection |
Ask user to confirm exact order ids (up to 5) before execution |
| Order missing/already filled |
Amendment/cancellation target is invalid |
Ask user to refresh open orders and retry |
| Market condition not met |
Trigger condition is not satisfied |
Return current price, target price, and difference |
| Pair unavailable |
Currency suspended or abnormal status |
Clearly state pair is currently not tradable |
Cross-Skill Workflows
Workflow A: Buy Then Amend
- Place order with
gate-exchange-spot (Case 2/9/23)
- If still unfilled, amend price (Case 17)
Workflow B: Cancel Then Rebuy
- Cancel all open orders to release funds (Case 6)
- Re-enter with updated strategy (Case 1/2/9)
Safety Rules
- For all-in/full-balance/one-click requests, restate key amount and symbol before execution.
- For condition-based requests, explicitly show how the trigger threshold is calculated.
- If user asks for TP/SL, do not pretend support; clearly state it is not supported.
- Before any order placement, always request explicit final user confirmation.
- Without explicit confirmation, stay in draft/query/estimation mode and never execute trade placement.
- Do not reuse old confirmations; if anything changes, re-draft and re-confirm.
- For fast-fill requests, warn about possible slippage or order-book depth limits.
- For chained actions (sell then buy), report step-by-step results clearly.
- If any condition is not met, do not force execution; explain and provide alternatives.
1---2name: gate-exchange-spot3description: Gate spot trading and account operations skill. Use when the user asks to buy/sell crypto, check account value, cancel/amend spot orders, place conditional or trigger orders, verify fills, or perform coin-to-coin swaps. Trigger phrases include 'buy coin', 'sell coin', 'trigger order', 'take profit', 'stop loss', 'cancel order', 'amend order', 'break-even price', 'rebalance', 'spot trading', or any request combining spot order execution with account checks.4---56# Gate Spot Trading 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_spot_get_currency31- cex_spot_get_currency_pair32- cex_spot_get_spot_accounts33- cex_spot_get_spot_batch_fee34- cex_spot_get_spot_candlesticks35- cex_spot_get_spot_order_book36- cex_spot_get_spot_price_triggered_order37- cex_spot_get_spot_tickers38- cex_spot_list_spot_account_book39- cex_spot_list_spot_my_trades40- cex_spot_list_spot_orders41- cex_spot_list_spot_price_triggered_orders42- cex_wallet_get_wallet_fee4344**Execution Operations (Write)**4546- cex_spot_amend_spot_batch_orders47- cex_spot_amend_spot_order48- cex_spot_cancel_all_spot_orders49- cex_spot_cancel_spot_batch_orders50- cex_spot_cancel_spot_order51- cex_spot_cancel_spot_price_triggered_order52- cex_spot_cancel_spot_price_triggered_order_list53- cex_spot_create_spot_batch_orders54- cex_spot_create_spot_order55- cex_spot_create_spot_price_triggered_order5657### Authentication58- API Key Required: Yes (see skill doc/runtime MCP deployment)59- Permissions: Spot:Write, Wallet:Read60- Get API Key: https://www.gate.io/myaccount/profile/api-key/manage6162### Installation Check63- Required: Gate (main)64- Install: Run installer skill for your IDE65 - Cursor: `gate-mcp-cursor-installer`66 - Codex: `gate-mcp-codex-installer`67 - Claude: `gate-mcp-claude-installer`68 - OpenClaw: `gate-mcp-openclaw-installer`6970## Domain Knowledge7172### Tool Mapping by Domain7374| Group | Tool Calls (`jsonrpc: call.method`) |75|------|------|76| Account and balances | `cex_spot_get_spot_accounts`, `cex_spot_list_spot_account_book` |77| Place/cancel/amend orders | `cex_spot_create_spot_order`, `cex_spot_create_spot_batch_orders`, `cex_spot_cancel_all_spot_orders`, `cex_spot_cancel_spot_order`, `cex_spot_cancel_spot_batch_orders`, `cex_spot_amend_spot_order`, `cex_spot_amend_spot_batch_orders` |78| Trigger orders (price orders) | `cex_spot_create_spot_price_triggered_order`, `cex_spot_list_spot_price_triggered_orders`, `cex_spot_get_spot_price_triggered_order`, `cex_spot_cancel_spot_price_triggered_order`, `cex_spot_cancel_spot_price_triggered_order_list` |79| Open orders and fills | `cex_spot_list_spot_orders`, `cex_spot_list_spot_my_trades` |80| Market data | `cex_spot_get_spot_tickers`, `cex_spot_get_spot_order_book`, `cex_spot_get_spot_candlesticks` |81| Trading rules | `cex_spot_get_currency`, `cex_spot_get_currency_pair` |82| Fees | `cex_wallet_get_wallet_fee`, `cex_spot_get_spot_batch_fee` |8384### Key Trading Rules8586- Use `BASE_QUOTE` format for trading pairs, for example `BTC_USDT`.87- Check quote-currency balance first before buy orders (for example USDT).88- Amount-based buys must satisfy `min_quote_amount` (commonly 10U).89- Quantity-based buys/sells must satisfy minimum size and precision (`min_base_amount` / `amount_precision`).90- Condition requests may be implemented either as immediate limit-order drafting or as trigger orders, depending on user intent ("if price reaches X then place order").91- Take-profit/stop-loss (TP/SL)-style requests are handled via spot trigger-order tools with explicit trigger and execution parameters.9293### Market Order Parameter Extraction Rules (Mandatory)9495When calling `cex_spot_create_spot_order` with `type=market`, fill `amount` by side:9697| side | `amount` meaning | Example |98|------|-------------|------|99| `buy` | Quote-currency amount (USDT) | "Buy 100U BTC" -> `amount="100"` |100| `sell` | Base-currency quantity (BTC/ETH, etc.) | "Sell 0.01 BTC" -> `amount="0.01"` |101102Pre-check before execution:103- `buy` market order: verify quote-currency balance can cover `amount` (USDT).104- `sell` market order: verify base-currency available balance can cover `amount` (coin quantity).105106## Workflow107108When the user asks for any spot trading operation, follow this sequence.109110### Step 1: Identify Task Type111112Classify the request into one of these six categories:1131. Buy (market/limit/full-balance buy)1142. Sell (full-position sell/conditional sell)1153. Account query (total assets, balance checks, tradability checks)1164. Order management (list open orders, amend, cancel)1175. Post-trade verification (filled or not, credited amount, current holdings)1186. Combined actions (sell then buy, buy then place sell order, trend-based buy)119120### Step 2: Extract Parameters and Run Pre-checks121122Extract key fields:123- `currency` / `currency_pair`124- `side` (`buy`/`sell`)125- `amount` (coin quantity) or `quote_amount` (USDT amount)126- `price` or price condition (for example "2% below current")127- trigger condition (execute only when condition is met)128129When `type=market`, normalize parameters as:130- `side=buy`: `amount = quote_amount` (USDT amount)131- `side=sell`: `amount = base_amount` (base-coin quantity)132133Pre-check order:1341. Trading pair/currency tradability status1352. Minimum order amount/size and precision1363. Available balance sufficiency1374. User condition satisfaction (for example "buy only below 60000")138139### Step 3: Final User Confirmation Before Any Order Placement (Mandatory)140141Before every `cex_spot_create_spot_order`, `cex_spot_create_spot_batch_orders`, or `cex_spot_create_spot_price_triggered_order`, always provide an **Order Draft** first, then wait for explicit confirmation.142143Required execution flow:1441. Send order draft (no trading call yet)1452. Wait for explicit user approval1463. Only after approval, submit the real order1474. Without approval, perform query/estimation only, never execute trading1485. Treat confirmation as single-use: after one execution, request confirmation again for any next order149150Required confirmation fields:151- trading pair (`currency_pair`)152- side and order type (`buy/sell`, `market/limit`)153- `amount` meaning and value154- limit price (if applicable) or pricing basis155- estimated fill / estimated cost or proceeds156- main risk note (for example slippage)157158Recommended draft wording:159- `Order Draft: BTC_USDT, buy, market, amount=100 USDT, estimated fill around current ask, risk: slippage in fast markets. Reply "Confirm order" to place it.`160161Allowed confirmation responses (examples):162- `Confirm order`, `Confirm`, `Proceed`, `Yes, place it`163164Hard blocking rules (non-bypassable):165- NEVER call `cex_spot_create_spot_order`, `cex_spot_create_spot_batch_orders`, or `cex_spot_create_spot_price_triggered_order` unless the user explicitly confirms in the immediately previous turn.166- If the conversation topic changes, parameters change, or multiple options are discussed, invalidate old confirmation and request a new one.167- For multi-leg execution (for example case 15/22/33), require confirmation for each leg separately before each trading call.168169If user confirmation is missing, ambiguous, or negative:170- do not place the order171- return a pending status and ask for explicit confirmation172- continue with read-only actions only (balance checks, market quotes, fee estimation)173174### Step 4: Call Tools by Scenario175176Use only the minimal tool set required for the task:177- Balance and available funds: `cex_spot_get_spot_accounts`178- Rule validation: `cex_spot_get_currency_pair`179- Live price and moves: `cex_spot_get_spot_tickers`180- Order placement: `cex_spot_create_spot_order` / `cex_spot_create_spot_batch_orders`181- Trigger-order placement/query/cancel: `cex_spot_create_spot_price_triggered_order` / `cex_spot_list_spot_price_triggered_orders` / `cex_spot_get_spot_price_triggered_order` / `cex_spot_cancel_spot_price_triggered_order` / `cex_spot_cancel_spot_price_triggered_order_list`182- Cancel/amend: `cex_spot_cancel_all_spot_orders` / `cex_spot_cancel_spot_order` / `cex_spot_cancel_spot_batch_orders` / `cex_spot_amend_spot_order` / `cex_spot_amend_spot_batch_orders`183- Open order query: `cex_spot_list_spot_orders` (use `status=open`)184- Fill verification: `cex_spot_list_spot_my_trades`185- Account change history: `cex_spot_list_spot_account_book`186- Batch fee query: `cex_spot_get_spot_batch_fee`187188### Step 5: Return Actionable Result and Status189190The response must include:191- Whether execution succeeded (or why it did not execute)192- Core numbers (price, quantity, amount, balance change)193- If condition not met, clearly explain why no order is placed now194195## Case Routing Map (1-36)196197### A. Buy and Account Queries (1-8)198199| Case | User Intent | Core Decision | Tool Sequence |200|------|----------|----------|----------|201| 1 | Market buy | Place market buy if USDT is sufficient | `cex_spot_get_spot_accounts` → `cex_spot_create_spot_order` |202| 2 | Buy at target price | Create a `limit buy` order | `cex_spot_get_spot_accounts` → `cex_spot_create_spot_order` |203| 3 | Buy with all balance | Use all available USDT balance to buy | `cex_spot_get_spot_accounts` → `cex_spot_create_spot_order` |204| 4 | Buy readiness check | Currency status + min size + current unit price | `cex_spot_get_currency` → `cex_spot_get_currency_pair` → `cex_spot_get_spot_tickers` |205| 5 | Asset summary | Convert all holdings to USDT value | `cex_spot_get_spot_accounts` → `cex_spot_get_spot_tickers` |206| 6 | Cancel all then check balance | Cancel all open orders and return balances | `cex_spot_cancel_all_spot_orders` → `cex_spot_get_spot_accounts` |207| 7 | Sell dust | Sell only if minimum size is met | `cex_spot_get_spot_accounts` → `cex_spot_get_currency_pair` → `cex_spot_create_spot_order` |208| 8 | Balance + minimum buy check | Place order only if account balance and `min_quote_amount` are both satisfied | `cex_spot_get_spot_accounts` → `cex_spot_get_currency_pair` → `cex_spot_create_spot_order` |209210### B. Smart Monitoring and Trading (9-16)211212| Case | User Intent | Core Decision | Tool Sequence |213|------|----------|----------|----------|214| 9 | Buy 2% lower | Place limit buy at current price -2% | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |215| 10 | Sell at +500 | Place limit sell at current price +500 | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |216| 11 | Buy near today's low | Buy only if current price is near 24h low | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |217| 12 | Sell on 5% drop request | Calculate target drop price and place sell limit order | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |218| 13 | Buy top gainer | Auto-pick highest 24h gainer and buy | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |219| 14 | Buy larger loser | Compare BTC/ETH daily drop and buy the bigger loser | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |220| 15 | Buy then place sell | Market buy, then place sell at +2% reference price | `cex_spot_create_spot_order` → `cex_spot_create_spot_order` |221| 16 | Fee estimate | Estimate total cost from fee rate and live price | `cex_wallet_get_wallet_fee` → `cex_spot_get_spot_tickers` |222223### C. Order Management and Amendment (17-25)224225| Case | User Intent | Core Decision | Tool Sequence |226|------|----------|----------|----------|227| 17 | Raise price for unfilled order | Confirm how much to raise (or target price), locate unfilled buy orders, confirm which order to amend if multiple, then amend limit price | `cex_spot_list_spot_orders`(status=open) → `cex_spot_amend_spot_order` |228| 18 | Verify fill and holdings | Last buy fill quantity + current total holdings | `cex_spot_list_spot_my_trades` → `cex_spot_get_spot_accounts` |229| 19 | Cancel if not filled | If still open, cancel and then recheck balance | `cex_spot_list_spot_orders`(status=open) → `cex_spot_cancel_spot_order` → `cex_spot_get_spot_accounts` |230| 20 | Rebuy at last price | Use last fill price, check balance, then place limit buy | `cex_spot_list_spot_my_trades` → `cex_spot_get_spot_accounts` → `cex_spot_create_spot_order` |231| 21 | Sell at break-even or better | Sell only if current price is above cost basis | `cex_spot_list_spot_my_trades` → `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` |232| 22 | Asset swap | Estimate value, if >=10U then sell then buy | `cex_spot_get_spot_accounts` → `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order`(sell) → `cex_spot_create_spot_order`(buy) |233| 23 | Buy if price condition met | Buy only when `current < 60000`, then report balance | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_order` → `cex_spot_get_spot_accounts` |234| 24 | Buy on trend condition | Buy only if 3 of last 4 hourly candles are bullish | `cex_spot_get_spot_candlesticks` → `cex_spot_create_spot_order` |235| 25 | Fast-fill limit buy | Use best opposite-book price for fast execution | `cex_spot_get_spot_order_book` → `cex_spot_create_spot_order` |236237### D. Advanced Spot Utilities (26-31)238239| Case | User Intent | Core Decision | Tool Sequence |240|------|----------|----------|----------|241| 26 | Filter and batch-cancel selected open orders | Verify target order ids exist in open orders, show candidate list, cancel only after user verification | `cex_spot_list_spot_orders`(status=open) → `cex_spot_cancel_spot_batch_orders` |242| 27 | Market slippage simulation | Simulate average fill from order-book asks for a notional buy, compare to last price | `cex_spot_get_spot_order_book` → `cex_spot_get_spot_tickers` |243| 28 | Batch buy placement | Check total required quote amount vs available balance, then place multi-order basket | `cex_spot_get_spot_accounts` → `cex_spot_create_spot_batch_orders` |244| 29 | Fee-rate comparison across pairs | Compare fee tiers and translate fee impact into estimated cost | `cex_spot_get_spot_batch_fee` → `cex_spot_get_spot_tickers` |245| 30 | Account-book audit + current balance | Show recent ledger changes for a coin and current remaining balance | `cex_spot_list_spot_account_book` → `cex_spot_get_spot_accounts` |246| 31 | Batch amend open buy orders by +1% | Filter open orders by pair, select up to 5 target buy orders, reprice and batch amend after user verification | `cex_spot_list_spot_orders`(status=open) → `cex_spot_amend_spot_batch_orders` |247248### E. Trigger Orders and TP/SL Automation (32-36)249250| Case | User Intent | Core Decision | Tool Sequence |251|------|----------|----------|----------|252| 32 | Conditional buy trigger order | Read current BTC price, compute 5% drop trigger, place buy trigger after confirmation | `cex_spot_get_spot_tickers` → `cex_spot_create_spot_price_triggered_order` |253| 33 | Dual TP/SL trigger placement | Check ETH available balance, build TP and SL trigger legs, confirm then place both | `cex_spot_get_spot_accounts` → `cex_spot_create_spot_price_triggered_order` → `cex_spot_create_spot_price_triggered_order` |254| 34 | Single trigger order progress query | Read trigger-order detail and compare against live market price to compute distance to trigger | `cex_spot_get_spot_price_triggered_order` → `cex_spot_get_spot_tickers` |255| 35 | Batch cancel BTC buy trigger orders | List open trigger orders, filter BTC buy side, confirm scope, then batch cancel | `cex_spot_list_spot_price_triggered_orders`(status=open) → `cex_spot_cancel_spot_price_triggered_order_list` |256| 36 | Single trigger/TP-SL order cancel | Verify one target trigger order is active, then cancel after confirmation | `cex_spot_get_spot_price_triggered_order` → `cex_spot_cancel_spot_price_triggered_order` |257258## Judgment Logic Summary259260| Condition | Action |261|-----------|--------|262| User asks to check balance before buying | Must call `cex_spot_get_spot_accounts` first; place order only if sufficient |263| User specifies buy/sell at target price | Use `type=limit` at user-provided price |264| User asks for fastest fill at current market | Prefer `market`; if "fast limit" is requested, use best book price |265| Market buy (`buy`) | Fill `amount` with USDT quote amount, not base quantity |266| Market sell (`sell`) | Fill `amount` with base-coin quantity, not USDT amount |267| User requests take-profit/stop-loss | Use trigger-order workflow: validate position size, draft TP+SL legs, then place after explicit confirmation |268| Any order placement request | Require explicit final user confirmation before `cex_spot_create_spot_order` |269| User has not replied with clear confirmation | Keep order as draft; no trading execution |270| Confirmation is stale or not from the immediately previous turn | Invalidate it and require a fresh confirmation |271| Multi-leg trading flow | Require per-leg confirmation before each `cex_spot_create_spot_order` |272| User asks to amend an unfilled buy order | Confirm price increase amount or exact target price before `cex_spot_amend_spot_order` |273| Multiple open buy orders match amendment request | Ask user to choose which order to amend before executing |274| User requests selected-order batch cancellation | Verify each order id exists/open, present list, and run `cex_spot_cancel_spot_batch_orders` only after user verification |275| User requests batch amend for open orders | Filter target pair open buy orders (max 5), compute repriced levels, and run `cex_spot_amend_spot_batch_orders` only after user verification |276| User requests trigger-order progress | Read one trigger order and compare current ticker price to trigger condition; return numeric distance |277| User requests trigger-order batch cancellation | Filter trigger orders by pair+side, present cancellation scope, then call `cex_spot_cancel_spot_price_triggered_order_list` after confirmation |278| User requests single trigger-order cancellation | Verify order is active/matching intent, then call `cex_spot_cancel_spot_price_triggered_order` after confirmation |279| User requests market slippage simulation | Use order-book depth simulation and compare weighted fill vs ticker last price |280| User requests multi-coin one-click buy | Validate summed quote requirement, then use `cex_spot_create_spot_batch_orders` |281| User requests fee comparison for multiple pairs | Use `cex_spot_get_spot_batch_fee` and convert to cost impact with latest prices |282| User requests account flow for a coin | Use `cex_spot_list_spot_account_book` and then reconcile with `cex_spot_get_spot_accounts` |283| User amount is too small | Check `min_quote_amount`; if not met, ask user to increase amount |284| User requests all-in buy/sell | Use available balance, then trim by minimum trade rules |285| Trigger condition not met | Do not place order; return current vs target price gap |286287## Report Template288289```markdown290## Execution Result291292| Item | Value |293|------|-----|294| Scenario | {case_name} |295| Pair | {currency_pair} |296| Action | {action} |297| Status | {status} |298| Key Metrics | {key_metrics} |299300{decision_text}301```302303Example `decision_text`:304- `✅ Condition met. Your order has been placed.`305- `📝 Order draft ready. Reply "Confirm order" to execute.`306- `⏸️ No order placed yet: current price is 60200, above your target 60000.`307- `❌ Not executed: minimum order amount is 10U, your input is 5U.`308309## Error Handling310311| Error Type | Typical Cause | Handling Strategy |312|----------|----------|----------|313| Insufficient balance | Not enough available USDT/coins | Return shortfall and suggest reducing order size |314| Minimum trade constraint | Below minimum amount/size | Return threshold and suggest increasing order size |315| Trigger-order parameter mismatch | Trigger rule/price/side is inconsistent with user intent | Return normalized trigger draft and require user reconfirmation |316| Missing final confirmation | User has not clearly approved final order summary | Keep order pending and request explicit confirmation |317| Stale confirmation | Confirmation does not match the current draft or is not in the previous turn | Reject execution and ask for reconfirmation |318| Draft-only mode | User has not confirmed yet | Only run query/estimation tools; do not call `cex_spot_create_spot_order`, `cex_spot_create_spot_batch_orders`, or `cex_spot_create_spot_price_triggered_order` |319| Ambiguous amendment target | Multiple candidate open buy orders | Keep pending and ask user to confirm order ID/row |320| Batch-cancel ambiguity | Some requested order ids are missing/not-open | Return matched vs unmatched ids and request reconfirmation |321| Batch-amend ambiguity | Candidate order set is unclear or exceeds max selection | Ask user to confirm exact order ids (up to 5) before execution |322| Order missing/already filled | Amendment/cancellation target is invalid | Ask user to refresh open orders and retry |323| Market condition not met | Trigger condition is not satisfied | Return current price, target price, and difference |324| Pair unavailable | Currency suspended or abnormal status | Clearly state pair is currently not tradable |325326## Cross-Skill Workflows327328### Workflow A: Buy Then Amend3293301. Place order with `gate-exchange-spot` (Case 2/9/23)3312. If still unfilled, amend price (Case 17)332333### Workflow B: Cancel Then Rebuy3343351. Cancel all open orders to release funds (Case 6)3362. Re-enter with updated strategy (Case 1/2/9)337338## Safety Rules339340- For all-in/full-balance/one-click requests, restate key amount and symbol before execution.341- For condition-based requests, explicitly show how the trigger threshold is calculated.342- If user asks for TP/SL, do not pretend support; clearly state it is not supported.343- Before any order placement, always request explicit final user confirmation.344- Without explicit confirmation, stay in draft/query/estimation mode and never execute trade placement.345- Do not reuse old confirmations; if anything changes, re-draft and re-confirm.346- For fast-fill requests, warn about possible slippage or order-book depth limits.347- For chained actions (sell then buy), report step-by-step results clearly.348- If any condition is not met, do not force execution; explain and provide alternatives.