Xpersona
G

Gate DEX Trade

CLAWHUB · Unverified

Gate DEX swap EXECUTION skill. For on-chain token exchange transactions that MODIFY blockchain state: swap, buy, sell, exchange, convert tokens, cross-chain...

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s172g4d1dcv6ccs6desbb2xw1583qza9:gate-dex-trade
  1. Install using `clawhub skill install s172g4d1dcv6ccs6desbb2xw1583qza9:gate-dex-trade` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/gate-exchange/gate-dex-trade before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-gate-exchange-gate-dex-trade/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,595 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: gate-dex-trade
version: "2026.4.2-1"
updated: "2026-04-02"
description: "Gate DEX swap EXECUTION skill. For on-chain token exchange transactions that MODIFY blockchain state: swap, buy, sell, exchange, convert tokens, cross-chain bridge. Every operation here results in an on-chain transaction requiring signing. This skill EXECUTES trades — it does not provide read-only data lookups or manage wallet accounts."
---

# Gate DEX Trade


> **Pure Routing Layer** — Swap EXECUTION only. Every operation produces an on-chain transaction. All specifications in `references/`.

## 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](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)

**Trigger Scenarios**: Use when the user wants to **execute a token exchange** that modifies blockchain state:
- Swap: "swap ETH for USDT", "exchange 100 USDC to DAI", "convert my BNB"
- Buy/Sell: "buy ETH", "sell my USDT", "purchase SOL"
- Cross-chain: "bridge ETH from Arbitrum to Base", "cross-chain swap"
- Swap quote: "how much USDT will I get for 1 ETH" (with intent to trade)

## Project convention — MCP only (this workspace)

**Do not use OpenAPI** for swap unless user explicitly asks OpenAPI/AK/SK. MCP unavailable → [`references/setup.md`](./references/setup.md) only.

---

**NOT this skill** (common misroutes):
- "what is the price of ETH" → `gate-dex-market` (read-only lookup, no trade intent)
- "check my swap history" → `gate-dex-wallet` (account query)
- "transfer ETH to 0xABC..." → `gate-dex-wallet` (direct transfer, not swap)
- "approve contract" (outside swap context) → `gate-dex-wallet` (DApp interaction)

---

## Routing Flow

```text
User triggers trading intent
  ↓
Step 1: Has user explicitly specified a mode?
  ├─ Explicitly mentions "OpenAPI" / "AK/SK" / "API Key" → OpenAPI mode
  ├─ Otherwise → MCP only (Step 2)
  └─ Not specified → Step 2
  ↓
Step 2: Is this a cross-chain swap?
  ├─ Cross-chain → Must use MCP mode (OpenAPI doesn't support cross-chain), proceed to Step 3
  └─ Same-chain / uncertain → Step 3
  ↓
Step 3: Gate Wallet MCP Server Discovery & Detection
  a) Scan configured MCP Server list for Servers providing `dex_tx_swap_quote`, `dex_tx_swap_prepare`, and staged swap signing tools
  b) If found → Record server identifier, verify with:
     CallMcpTool(server="<identifier>", toolName="dex_chain_config", arguments={chain: "ETH"})
     ├─ Success → MCP mode
     └─ Failed → Step 4
  c) No matching Server → Step 4
  ↓
Step 4: MCP unavailable → setup guide only ([`references/setup.md`](./references/setup.md)), no OpenAPI fallback
```

---

## Mode Dispatch

### MCP Mode

**Read and strictly follow** [`references/mcp.md`](./references/mcp.md), execute according to its complete workflow.

Includes: connection detection, authentication (mcp_tok

README.md

# Gate DEX Trade

> **Comprehensive Trading Skill** — MCP + OpenAPI dual modes with intelligent routing

Provides complete Swap trading capabilities through Gate DEX. Designed for AI assistants (Cursor / Claude Code / Windsurf, etc.), supports EVM multi-chain + Solana, supports cross-chain Swap.

---

## Quick Start

```bash
cd gate-dex-trade
./install.sh
```

Verify: `"Swap 100 USDT for ETH"` or `"Use OpenAPI mode to swap"`

---

## Mode Overview

| Dimension | MCP Mode | OpenAPI Mode |
|-----------|----------|-------------|
| **Connection** | Gate Wallet MCP Server | Direct AK/SK API |
| **Authentication** | mcp_token (OAuth login) | HMAC-SHA256 signature |
| **Execution** | Staged swap + local check-in CLI | Step-by-step lifecycle |
| **Cross-chain** | Supported | Same-chain only |
| **Three-step Confirmation** | Mandatory | Mandatory |

---

## Trigger Keywords

- **Trading**: `swap`, `exchange`, `buy`, `sell`, `trade`, `cross-chain`
- **Queries**: `quote`, `rate`, `gas fees`, `slippage`, `transaction status`
- **Mode**: `OpenAPI mode`, `AK/SK`, `MCP mode`

---

## Routing Flow

```text
User triggers trading intent
  ↓
Explicitly specify mode?
  ├─ "OpenAPI/AK/SK" → references/openapi.md
  ├─ "MCP" → MCP mode (guide setup on failure)
  └─ Not specified → Environment detection
  ↓
Cross-chain Swap?
  ├─ Yes → Force MCP mode
  └─ No → MCP Server detection
  ↓
MCP Server available?
  ├─ Yes → references/mcp.md
  └─ No → Prompt setup + fallback to references/openapi.md
```

---

## File Architecture

```text
gate-dex-trade/
├── SKILL.md              # Pure routing layer (AI reads this first)
├── README.md             # This document (human-facing)
├── CHANGELOG.md          # Change log
├── install.sh            # Interactive installation script
└── references/
    ├── mcp.md            # MCP mode complete specification
    ├── openapi.md        # OpenAPI mode complete specification
    └── setup.md          # MCP Server setup guide (multi-platform)
```

---

## Cross-Skill Collaboration

| Source Skill | Scenario | Information Passed |
|-------------|----------|-------------------|
| `gate-dex-wallet` | Trade after viewing balance | Chain, token addresses, balance |
| `gate-dex-market` | Buy after viewing market data | Token info, price, market cap |
| `gate-dex-wallet/references/transfer.md` | Exchange remaining after transfer | Chain, tokens, wallet addresses |

---

## Related Skills

- **[gate-dex-wallet](../gate-dex-wallet/)** — Wallet (authentication, assets, transfers, DApp)
- **[gate-dex-market](../gate-dex-market/)** — Market data queries (quotes, rankings, audits)

tools/tx-checkin/README.md

# tx-checkin

Trade swap check-in caller.

This directory exposes a Go binary that reads the JSON returned by
`dex_tx_swap_checkin_preview`, sends the tx check-in HTTP request, and prints
the full response body to stdout.

## Usage

Use the prebuilt binary from this directory:

```bash
./swap-checkin-mac --help
# Linux: ./swap-checkin-linux --help
```

The binary only accepts command-line JSON input:

```bash
./swap-checkin-mac --preview-json '{"mcp_token":"...","user_wallet":"0x123","chain":"ethereum","chain_category":"evm","checkin_message":"...","type":"swap"}'
# Linux: ./swap-checkin-linux with the same --preview-json value
```

```powershell
# Windows (amd64): from this directory
.\swap-checkin-win.exe --preview-json '{"mcp_token":"...","user_wallet":"0x123","chain":"ethereum","chain_category":"evm","checkin_message":"...","type":"swap"}'
```

## Input Format

`--preview-json` must be a standard JSON string, not a Go struct literal.

In other words, the caller should take the full result returned by
`dex_tx_swap_checkin_preview`, serialize it to JSON text, and pass that string
into this binary. The binary will unmarshal that JSON, build the check-in
request, call the API, and print the raw response body.

## Output

Stdout is the full tx check-in response body, for example:

```json
{"code":0,"msg":"success","data":{"checkin_token":"...","need_otp":false}}
```

## Required Fields

The preview payload must contain:

- `mcp_token`
- `user_wallet`
- `chain`
- `chain_category`
- `checkin_message`

## Notes

- The only CLI input is `--preview-json`.
- Use `swap-checkin-mac` on macOS, `swap-checkin-linux` on Linux, and `swap-checkin-win.exe` on Windows (amd64).
- `checkin_path` from preview is preferred when present; otherwise `/api/v1/tx/checkin` is used.
- `mcp_token` is used directly as the `Authorization` header value; the binary does not add a `Bearer ` prefix.
- `api-timestamp` and `api-code` are generated internally by the binary.
- The request body includes `source: 3`.

_meta.json

{
  "ownerId": "kn74x9hm07phcw70v30nff2x2h82t09z",
  "slug": "gate-dex-trade",
  "version": "1.0.3",
  "publishedAt": 1775557929999
}

references/mcp.md

---
name: gate-dex-trade-mcp
version: "2026.4.2-1"
updated: "2026-04-02"
description: "Gate Wallet Swap/DEX trading. Get quotes, run staged swap with local check-in CLI, and track status. Use when users want to 'swap USDT to ETH', 'swap', 'exchange tokens', 'buy tokens', 'sell tokens'. Includes mandatory three-step confirmation gate. Supports EVM multi-chain + Solana, supports cross-chain Swap."
---

# Gate Wallet Swap Skill

> Swap/DEX Domain — Quote retrieval, slippage control, route display, staged swap execution, local check-in CLI, status tracking, includes mandatory three-step confirmation gateway.

**Trigger Scenarios**: When users mention "swap", "exchange", "buy", "sell", "convert", "swap X for Y", "cross-chain", or when other Skills guide users to execute token swaps.

## Step 0: MCP Server Connection Detection (Mandatory)

See SKILL.md for MCP Server detection. This file assumes MCP Server is available.

## Authentication Instructions

All operations of this Skill **require `mcp_token`**. Must confirm user is logged in before calling any tools.

- If currently no `mcp_token` → Guide to `gate-dex-wallet/references/auth.md` to complete login then return.
- If `mcp_token` expired (MCP Server returns token expired error) → First try `dex_auth_refresh_token` silent refresh, guide re-login on failure.

**Supported Authentication Methods**:
- Google OAuth login (Google Device Flow)
- Gate OAuth login (Gate account system)

**Authentication URL Display Rules**:
- When MCP returns login authorization URL, display complete clickable link directly
- Do not add extra decorative symbols around URL (such as quotes, brackets, etc.)
- Do not escape URL content, ensure users see complete copyable links
- Display format example:

```
Please open the following link in your browser to complete login:

https://accounts.google.com/o/oauth2/device?user_code=ABCD-EFGH

or

https://gate.io/oauth/authorize?client_id=xxx&redirect_uri=xxx

Complete authentication and return here to continue.
```

**Important**: URL must be displayed as plain text, do not use Markdown link format or other decorations.

## MCP Resource

### `swap://supported_chains` — List of Swap-supported chains

**Must** read this Resource before calling `dex_tx_swap_quote` or any staged swap signing tool to verify if chain_id supports Swap and determine address grouping (EVM vs Solana).

```
FetchMcpResource(server="gate-dex", uri="swap://supported_chains")
```

Returns chain list grouped by address type (evm / solana), used for:
- Verifying if user-specified chain supports Swap
- Determining whether `user_wallet` should use EVM address or SOL address
- Determining if source and target chains belong to different address groups for cross-chain Swap (requiring `to_wallet`)

## MCP Tool Call Specifications

### 1. `dex_wallet_get_token_list` (Cross-Skill Call) — Query balance for validation

**Must** call this tool before Swap to validate input token balance and Gas token balance. This tool belong

Sponsored

Ads related to Gate DEX Trade and adjacent AI workflows.