Overview
Gate Exchange Trading provides unified procedures for executing Spot, Margin, and USDT Perpetual Futures trades on Gate.io. It integrates with both the native SDK (Python/Node.js) and the gate-cli binary. This skill outlines risk checks, order drafting, confirmation gates, and post-state verification to prevent double-fills and margin liquidations.
When to Use
Trigger phrases:
- "gate-exchange-trading", "Execute order on Gate.io"
- "futures position gate.io", "check open orders Gate"
- "margin borrow Gate exchange", "spot buy BTC on gate"
Situations:
- Executing spot limit/market orders and managing order books on Gate.io.
- Opening, closing, or managing leverage/margins on USDT perpetual futures contracts.
- Auditing balance requirements and performing pre-trade risk grading (GO, CAUTION, BLOCK) before order entry.
When NOT to Use
- Task is about on-chain Gate DEX or GateChain EVM trading (use
gate-dex-wallet).
- Task is about news analysis without active trading intent (use
social-intelligence or scrapers).
- Task requires fully automated trading without user confirmation gates (bypasses safety rules).
Operational Workflow
Step 1: Pre-trade Risk Check (Briefing)
Before submitting any order, calculate the risk envelope.
import os
from gate_api import ApiClient, Configuration, SpotApi
config = Configuration(
key=os.getenv("GATE_API_KEY"),
secret=os.getenv("GATE_API_SECRET")
)
api_client = ApiClient(config)
spot_api = SpotApi(api_client)
# Check spot account balance
balances = spot_api.list_spot_accounts()
Step 2: Produce Order Draft
Specify symbol, order direction (buy/sell), price type, and size.
Step 3: Confirmation and Execution
Verify user has explicitly confirmed the Order Draft in the immediately preceding turn. Run execution commands:
gate-cli cex spot order create --symbol BTC_USDT --side buy --amount 0.001 --price 65000 --type limit
Anti-Rationalization Table
| Rationalization |
Reality |
| "I'll store the API keys in plain text in config settings" |
Configuration values slip into logs, backups or git. Keys belong strictly in GATE_API_KEY / GATE_API_SECRET environments. |
| "I can skip the confirmation gate for market close orders" |
A market close during high volatility without confirmation can incur large slippage losses. User approval is always mandatory. |
| "I don't need to query account balance before placing a limit order" |
Placing orders that fail for insufficient balance wastes RPC limits and disrupts agent workflow continuity. Check balances first. |
Verification
Verification Checklist
Process
- Classify task mode - Trade decision vs Trade draft + execute vs position management.
- Collect target details - asset, direction, market type (spot vs futures).
- Build pre-trade brief - check balance, calculate risk limits.
- Draft order - produce JSON/Markdown layout of the intended trade.
- Request confirmation - get explicit user go-signal.
- Execute trade - invoke api/cli endpoint.
- Post-execution read - verify fills and status.
1---2name: gate-exchange-trading3description: "Use when executing trades on Gate.io Spot & Futures markets using CCXT/SDK or gate-cli. Triggers on spot buying, margin borrowing, orderbook depth checks, futures position management, or subaccount trade routing."4domain: trading5author: oyi776license: Apache-2.07subdomain: trading8tags:9 - gate10 - exchange11 - spot12 - futures13 - trading14version: 1.0.015category: trading16metadata:17 source: https://skillmd.com/skills/oyi77/gate-exchange-trading18---1920## Overview2122Gate Exchange Trading provides unified procedures for executing Spot, Margin, and USDT Perpetual Futures trades on Gate.io. It integrates with both the native SDK (Python/Node.js) and the `gate-cli` binary. This skill outlines risk checks, order drafting, confirmation gates, and post-state verification to prevent double-fills and margin liquidations.2324## When to Use2526**Trigger phrases:**27- "gate-exchange-trading", "Execute order on Gate.io"28- "futures position gate.io", "check open orders Gate"29- "margin borrow Gate exchange", "spot buy BTC on gate"3031**Situations:**32- Executing spot limit/market orders and managing order books on Gate.io.33- Opening, closing, or managing leverage/margins on USDT perpetual futures contracts.34- Auditing balance requirements and performing pre-trade risk grading (GO, CAUTION, BLOCK) before order entry.3536## When NOT to Use3738- Task is about on-chain Gate DEX or GateChain EVM trading (use `gate-dex-wallet`).39- Task is about news analysis without active trading intent (use `social-intelligence` or `scrapers`).40- Task requires fully automated trading without user confirmation gates (bypasses safety rules).4142## Operational Workflow4344### Step 1: Pre-trade Risk Check (Briefing)45Before submitting any order, calculate the risk envelope.46```python47import os48from gate_api import ApiClient, Configuration, SpotApi4950config = Configuration(51 key=os.getenv("GATE_API_KEY"),52 secret=os.getenv("GATE_API_SECRET")53)54api_client = ApiClient(config)55spot_api = SpotApi(api_client)5657# Check spot account balance58balances = spot_api.list_spot_accounts()59```6061### Step 2: Produce Order Draft62Specify symbol, order direction (buy/sell), price type, and size.6364### Step 3: Confirmation and Execution65Verify user has explicitly confirmed the `Order Draft` in the immediately preceding turn. Run execution commands:66```bash67gate-cli cex spot order create --symbol BTC_USDT --side buy --amount 0.001 --price 65000 --type limit68```6970## Anti-Rationalization Table7172| Rationalization | Reality |73|---|---|74| "I'll store the API keys in plain text in config settings" | Configuration values slip into logs, backups or git. Keys belong strictly in `GATE_API_KEY` / `GATE_API_SECRET` environments. |75| "I can skip the confirmation gate for market close orders" | A market close during high volatility without confirmation can incur large slippage losses. User approval is always mandatory. |76| "I don't need to query account balance before placing a limit order" | Placing orders that fail for insufficient balance wastes RPC limits and disrupts agent workflow continuity. Check balances first. |7778## Verification7980### Verification Checklist81- [ ] Account balance checks return clean JSON before drafting82- [ ] CCXT / Gate V4 Api client registers with valid environment key pair83- [ ] CLI command `gate-cli --version` resolves successfully on PATH84- [ ] Pre-trade Trading Brief produces explicit indicator (`GO`, `CAUTION`, or `BLOCK`)8586## Process87881. **Classify task mode** - Trade decision vs Trade draft + execute vs position management.892. **Collect target details** - asset, direction, market type (spot vs futures).903. **Build pre-trade brief** - check balance, calculate risk limits.914. **Draft order** - produce JSON/Markdown layout of the intended trade.925. **Request confirmation** - get explicit user go-signal.936. **Execute trade** - invoke api/cli endpoint.947. **Post-execution read** - verify fills and status.