用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/qhkm/zeptoclaw-skills --skill uniswap命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Give your agent a standalone on-chain wallet for gasless trades, funding, and autonomous x402 M2M payments.
Deploy ERC20 tokens on Base, Ethereum, Arbitrum, and other EVM chains using the Clanker SDK. Use when the user wants to deploy a new token, create a memecoin, set up token vesting, configure airdrops, manage token rewards, claim LP fees, or update token metadata. Supports V4 deployment with vaults, airdrops, dev buys, custom market caps, vanity addresses, and multi-chain deployment.
AI-powered crypto trading agent and LLM gateway via natural language. Use when the user wants to trade crypto, check portfolio balances, view token prices, transfer crypto, manage NFTs, use leverage, bet on Polymarket, deploy tokens, set up automated trading, sign and submit raw transactions, or access LLM models through the Bankr LLM gateway funded by your Bankr wallet. Supports Base, Ethereum, Polygon, Solana, and Unichain.
正在显示 SKILL.md
基于 SOC 职业分类
| name | uniswap |
| version | 1.0.0 |
| description | Get swap quotes, check approvals, execute swaps, and generate deep links using the Uniswap Trading API. |
| author | aimaneth |
| license | MIT |
| tags | ["crypto","defi","trading","uniswap"] |
| env_needed | [{"name":"UNISWAP_API_KEY","description":"API key from the Uniswap Developer Portal (https://developers.uniswap.org/)","required":true}] |
| metadata | {"zeptoclaw":{"emoji":"🦄","requires":{"anyBins":["curl","jq"]}}} |
Interact with Uniswap — the largest decentralised exchange — via the Trading API. Get swap quotes, check token approvals, execute swaps, and generate deep links that open the Uniswap UI with pre-filled parameters.
Based on Uniswap AI — adapted for ZeptoClaw agents.
export UNISWAP_API_KEY="your_api_key_here"
Base URL: https://trade-api.gateway.uniswap.org/v1
Required headers for all requests:
Content-Type: application/json
x-api-key: $UNISWAP_API_KEY
x-universal-router-version: 2.0
Get the best price for a token swap. This is the most common operation.
curl -s -X POST https://trade-api.gateway.uniswap.org/v1/quote \
-H "Content-Type: application/json" \
-H "x-api-key: $UNISWAP_API_KEY" \
-H "x-universal-router-version: 2.0" \
-d '{
"swapper": "0xYOUR_WALLET_ADDRESS",
"tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"tokenInChainId": "1",
"tokenOutChainId": "1",
"amount": "1000000000000000000",
"type": "EXACT_INPUT",
"slippageTolerance": 0.5,
"routingPreference": "BEST_PRICE"
}' | jq .
The above example quotes swapping 1 WETH → USDC on Ethereum mainnet.
Key parameters:
| Parameter | Values |
|---|---|
type | EXACT_INPUT or EXACT_OUTPUT |
slippageTolerance | 0–100 (percentage) |
routingPreference | BEST_PRICE, FASTEST, or CLASSIC |
protocols | Optional: ["V2", "V3", "V4"] |
Response includes quote.output.amount, quote.gasFeeUSD, and routing details.
Tip: Use the
gasFeeUSDfield to display gas costs. Don't manually convertgasFee(wei) — it leads to inaccurate estimates.
Before swapping ERC-20 tokens, check if the token is approved for the Uniswap router.
curl -s -X POST https://trade-api.gateway.uniswap.org/v1/check_approval \
-H "Content-Type: application/json" \
-H "x-api-key: $UNISWAP_API_KEY" \
-H "x-universal-router-version: 2.0" \
-d '{
"walletAddress": "0xYOUR_WALLET_ADDRESS",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "1000000000",
"chainId": 1
}' | jq .
approval is null — token is already approved, proceed to swap.approval contains a transaction — sign and submit it before swapping.The full swap flow is: check_approval → quote → swap.
After getting a quote, send it to the swap endpoint to get a ready-to-sign transaction:
# Step 1: Get quote (see above)
# Step 2: Send quote response to /swap
curl -s -X POST https://trade-api.gateway.uniswap.org/v1/swap \
-H "Content-Type: application/json" \
-H "x-api-key: $UNISWAP_API_KEY" \
-H "x-universal-router-version: 2.0" \
-d '{
"routing": "CLASSIC",
"quote": {
"input": {"token": "0x...", "amount": "1000000000000000000"},
"output": {"token": "0x...", "amount": "999000000"},
"slippage": 0.5
},
"swapper": "0xYOUR_WALLET_ADDRESS",
"tokenIn": "0x...",
"tokenOut": "0x...",
"tokenInChainId": "1",
"tokenOutChainId": "1",
"amount": "1000000000000000000",
"type": "EXACT_INPUT"
}' | jq .
Response returns a ready-to-sign transaction with to, from, data, value, and gasLimit.
Important: Spread the quote response into the swap request body — don't wrap it in
{"quote": ...}. Also strip anynullfields likepermitData: nullbefore sending.
Generate a URL that opens the Uniswap swap interface with parameters pre-filled:
# ETH → USDC on Ethereum
echo "https://app.uniswap.org/swap?chain=ethereum&inputCurrency=ETH&outputCurrency=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&exactAmount=1&exactField=input"
# USDC → ETH on Base
echo "https://app.uniswap.org/swap?chain=base&inputCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&outputCurrency=ETH&exactAmount=100&exactField=input"
Deep link parameters:
| Parameter | Description |
|---|---|
chain | ethereum, base, arbitrum, etc. |
inputCurrency | Token address or ETH |
outputCurrency | Token address or ETH |
exactAmount | Amount in human-readable units |
exactField | input or output |
| Chain ID | Chain | Chain ID | Chain |
|---|---|---|---|
| 1 | Ethereum | 8453 | Base |
| 10 | Optimism | 42161 | Arbitrum |
| 56 | BNB Chain | 42220 | Celo |
| 130 | Unichain | 43114 | Avalanche |
| 137 | Polygon | 81457 | Blast |
| 196 | X Layer | 7777777 | Zora |
| 324 | zkSync | 480 | World Chain |
| Token | Ethereum (1) | Base (8453) |
|---|---|---|
| WETH | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 | 0x4200000000000000000000000000000000000006 |
| USDC | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| USDT | 0xdAC17F958D2ee523a2206206994597C13D831ec7 | — |
| DAI | 0x6B175474E89094C44Da98b954EedeAC495271d0F | — |
0.5 (0.5%) for stablecoins, 1.0–3.0 for volatile pairstokenInChainId and tokenOutChainId must be strings (e.g. "1"), not numberssignature and permitData must both be present or both absent — never set permitData: nullETH in deep links. For API calls, use the WETH address