gate-dex-trade

Gate DEX trading comprehensive skill. Supports MCP and OpenAPI dual modes: MCP mode calls through gate-wallet service (requires authentication), OpenAPI mode calls directly through AK/SK. Use when users mention swap, exchange, buy, sell, quote, trade. Automatically select the most suitable calling method based on environment.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gate-dex-trade" with this command: npx skills add gate-exchange/gate-dex-trade

Gate DEX Trade

Trading Comprehensive Skill — MCP + OpenAPI dual mode support, intelligent routing selects optimal trading method

Trigger Scenarios: Use when users mention "swap", "exchange", "buy", "sell", "trade", "quote" and other related operations.


🎯 Dual Mode Architecture

ModeConnection MethodAdvantagesUse Cases
🔗 MCP Modegate-wallet MCP ServerUnified authentication, wallet ecosystem integrationComplete trading process, cross-Skill collaboration
OpenAPI ModeAK/SK direct callsIndependent execution, complete lifecycleFast trading, full chain control

📋 Smart Routing Rules

System automatically selects calling mode based on following priorities:

PriorityConditionSelected ModeRouting Target
1Explicitly mentions "OpenAPI", "AK/SK"⚡ OpenAPIreferences/openapi.md
2Exists ~/.gate-dex-openapi/config.json⚡ OpenAPIreferences/openapi.md
3From wallet Skills cross-Skill calls🔗 MCPCurrent SKILL.md main process
4Default scenario🔗 MCPCurrent SKILL.md main process

User Preferences:

  • Pursue complete ecosystem integration → MCP mode
  • Pursue independent fast execution → OpenAPI mode

MCP Server Connection Detection

First Session Detection

Before first MCP tool call in session, perform one connection probe to confirm Gate Wallet MCP Server availability. No need to repeat detection for subsequent operations.

CallMcpTool(server="gate-wallet", toolName="chain.config", arguments={chain: "eth"})
ResultHandling
SuccessMCP Server available, subsequent operations directly call business tools, no need to probe again
FailureDisplay configuration guidance based on error type (see error handling below)

Runtime Error Fallback

If business tool calls fail during subsequent operations (returning connection errors, timeouts etc.), handle according to following rules:

Error TypeKeywordsHandling
MCP Server not configuredserver not found, unknown serverDisplay MCP Server configuration guidance
Remote service unreachableconnection refused, timeout, DNS errorPrompt to check server status and network connection
Authentication failed401, unauthorized, x-api-keyPrompt to contact administrator for API Key

Authentication Description

All operations in MCP mode require mcp_token. Must confirm user is logged in before calling any tool.

  • If currently no mcp_token → Guide to gate-dex-wallet/references/auth to complete login then return
  • If mcp_token expired (MCP Server returns token expired error) → First try auth.refresh_token silent refresh, guide re-login if failed

MCP Tool Call Specification (Main Process)

1. tx.quote — Get Swap Quote

Get Swap quote from input token to output token.

FieldDescription
Tool Nametx.quote
Parameters{ chain_id_in: string, chain_id_out: string, token_in: string, token_out: string, amount: string, slippage?: number, user_wallet: string, native_in?: boolean, native_out?: boolean, mcp_token: string }
ReturnQuote details including exchange rate, slippage, routing path, estimated Gas etc

2. tx.swap — Execute Swap

One-shot Swap execution (Quote→Build→Sign→Submit single call).

FieldDescription
Tool Nametx.swap
ParametersSame as tx.quote + account_id
ReturnTransaction result

3. tx.swap_detail — Query Swap Status

(Other MCP tool specifications...)


Sub-module Routing

Route to specific implementation based on mode detection result and user intent:

Routing ConditionTargetDescription
OpenAPI environment + related intentreferences/openapi.mdComplete OpenAPI call specification
MCP environment + trading intentCurrent SKILL.md main processMCP tool calls and three-step confirmation process

Operation Process

Process A: Smart Mode Selection

First session detection (if needed)
  ↓
Environment detection:
  1. Check ~/.gate-dex-openapi/config.json
  2. Check gate-wallet MCP Server
  ↓
Select calling mode based on detection result:
  → OpenAPI mode: references/openapi.md
  → MCP mode: Current main process

Process B: MCP Swap Execution (Main Process)

Authentication check → Balance verification → Trading pair confirmation 
  → tx.quote → Quote display → Signature authorization confirmation 
    → tx.swap → tx.swap_detail

Cross-Skill Collaboration

CallerScenarioTool Used
gate-dex-walletUser views balance then wants to exchange tokensMCP mode call
gate-dex-marketUser views market then wants to buy certain tokenMCP mode call

Supported Chains

Chain IDNetwork NameMCP SupportOpenAPI Support
eth / 1Ethereum
bsc / 56BNB Smart Chain
polygon / 137Polygon
arbitrum / 42161Arbitrum One
optimism / 10Optimism
avax / 43114Avalanche
base / 8453Base
sol / 501Solana

Security Rules

  1. Mode selection transparency: Clearly inform users of current calling mode and reason
  2. Authentication isolation: MCP mode uses mcp_token, OpenAPI mode uses AK/SK
  3. Three-step confirmation gating: MCP mode includes trading pair confirmation → quote display → signature authorization confirmation
  4. Balance verification: Mandatory check asset sufficiency before trading
  5. Risk alerts: Mandatory warning when price difference > 5%, high slippage MEV risk alerts

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

Binance Trade Hunter

Binance trading skill for coin analysis, pump detection, and one-click trading via Telegram. Use when the user wants to analyze crypto coins, check market tr...

Registry SourceRecently Updated
Web3

test

Monitor and analyze DeFi positions across protocols and chains. Track LP (liquidity provider) positions, staking rewards, yield farming returns, impermanent...

Registry SourceRecently Updated
Web3

Wallet Tracker

Multi-chain wallet asset tracker — monitor EVM and Solana wallets, aggregate portfolio, and detect holding changes. Use when you need wallet tracker capabili...

Registry SourceRecently Updated
Web3

Product Framework

Design and visualize AI product frameworks including layered architecture, value chains, capability maps, and competitive positioning for product managers.

Registry SourceRecently Updated
00Profile unavailable