ZeroEx Swap Skill
⚠️ **SECURITY WARNING:** This skill involves real funds. Review all parameters before executing swaps.
Best use case
ZeroEx Swap Skill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
⚠️ **SECURITY WARNING:** This skill involves real funds. Review all parameters before executing swaps.
Teams using ZeroEx Swap Skill should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/zeroex-swap/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ZeroEx Swap Skill Compares
| Feature / Agent | ZeroEx Swap Skill | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
⚠️ **SECURITY WARNING:** This skill involves real funds. Review all parameters before executing swaps.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# ZeroEx Swap Skill
⚠️ **SECURITY WARNING:** This skill involves real funds. Review all parameters before executing swaps.
## Install
```bash
cd skills/zeroex-swap
npm install
```
## Required Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| `ZEROEX_API_KEY` | Get from https://dashboard.0x.org/ | Yes |
| `PRIVATE_KEY` | Wallet private key (hex, without 0x prefix) | Yes |
| `RPC_URL` | RPC endpoint for chain (optional, defaults provided) | No |
**Declared required env vars:** `ZEROEX_API_KEY`, `PRIVATE_KEY`
```bash
export ZEROEX_API_KEY="your-0x-api-key"
export PRIVATE_KEY="your-private-key-hex"
export RPC_URL="https://mainnet.base.org" # optional
```
## Usage
### Get Price Quote
```bash
node quote.js --sell USDC --buy WETH --amount 1 --chain base
```
### Execute Swap (sell → buy)
```bash
node swap.js --sell USDC --buy WETH --amount 1 --chain base
```
### Execute Swap (buy example)
```bash
node swap.js --sell WETH --buy USDC --amount 0.01 --chain base
```
## Trade History
### getSwapTrades
```bash
curl -s "https://api.0x.org/trade-analytics/swap?chainId=8453&taker=0xYOUR_WALLET" \
-H "0x-api-key: $ZEROEX_API_KEY" \
-H "0x-version: v2"
```
### getGaslessTrades
```bash
curl -s "https://api.0x.org/trade-analytics/gasless?chainId=8453&taker=0xYOUR_WALLET" \
-H "0x-api-key: $ZEROEX_API_KEY" \
-H "0x-version: v2"
```
## Gasless Swap (Meta-transaction)
**Flow:**
1. Get gasless quote
2. Sign EIP-712 payload
3. Submit meta-tx
### 1) Get gasless quote
```bash
curl -s "https://api.0x.org/gasless/quote?sellToken=USDC&buyToken=WETH&sellAmount=1000000&chainId=8453&taker=0xYOUR_WALLET" \
-H "0x-api-key: $ZEROEX_API_KEY" \
-H "0x-version: v2"
```
### 2) Sign EIP-712 (use viem)
```js
// use viem to sign quote.trade.eip712
await client.signTypedData({
domain: quote.trade.eip712.domain,
types: quote.trade.eip712.types,
message: quote.trade.eip712.message,
primaryType: quote.trade.eip712.primaryType
});
```
### 3) Submit
```bash
curl -s -X POST "https://api.0x.org/gasless/submit" \
-H "0x-api-key: $ZEROEX_API_KEY" \
-H "0x-version: v2" \
-H "Content-Type: application/json" \
-d '{"trade": {"type":"settler_metatransaction","eip712": {"domain": {"name": "Settler", "chainId": 8453, "verifyingContract": "0x..."},"types": {...},"message": {...},"primaryType":"..."},"signature": {"v": 27, "r": "0x...", "s": "0x...", "signatureType": 2}}}'
```
## Security Best Practices
- Use a dedicated hot wallet
- Set slippage protection
- Approve exact amounts only
- Use your own RPC via `RPC_URL`Related Skills
sushiswap-sdk
TypeScript SDK for interacting with the SushiSwap Aggregator and related primitives. This SDK is a typed wrapper over the SushiSwap API, providing ergonomic helpers for token amounts, prices, quotes, and swap transaction generation. USE THIS SKILL WHEN: - Building TypeScript or JavaScript applications - You want strongly typed token, amount, and fraction primitives - You need to request swap quotes or executable swap transactions via code - You want safer arithmetic, formatting, and comparisons without floating point errors - You prefer SDK-based integration over raw HTTP requests
sushiswap-api
REST API for optimized token swapping (including executable transaction generation), swap quoting, and pricing using the SushiSwap Aggregator. Use this skill when the user wants to: - Get a swap quote between two tokens on 40+ evm networks - Generate executable swap transaction data - Fetch token prices for a specific network or token - Retrieve token metadata - Discover supported AMM liquidity sources - Integrate SushiSwap swapping or pricing logic via HTTP/REST (and not the SushiSwap Javascript API)
tron-swap
This skill should be used when the user asks to 'swap tokens on TRON', 'buy token on TRON', 'sell TRC-20 token', 'trade TRX for USDT', 'exchange tokens on SunSwap', 'DEX trade on TRON', 'get swap quote on TRON', 'best route for TRON swap', or mentions swapping, trading, buying, selling, or exchanging tokens on the TRON network. Aggregates liquidity from SunSwap V2/V3, Sun.io, and other TRON DEXes. Do NOT use for staking — use tron-staking. Do NOT use for token research — use tron-token.
tempo-stable-uniswap-swaps
Tempo stablecoin and token swap operations for agents. Use when working with pathUSD/USDC.e balances, swapping between USDC.e and pathUSD, or executing any-token swaps via Uniswap on Tempo with quote, Permit2 approvals, simulation, and broadcast.
faceswap
AI Face Swap - Swap face in video, deepfake face replacement, face swap for portraits. Use from command line. Supports local video files, YouTube, Bilibili URLs, auto-download, real-time progress tracking.
grand-bazaar-swap
Perform and document Grand Bazaar P2P swaps on Base using deployed AirSwap Swap contracts. Includes repeatable workflows for approvals, EIP-712 signing, cast/deeplink posting, execution, and verification across ERC20/ERC721/ERC1155 routes.
okx-dex-swap
Execute token swaps on-chain via OKX DEX Aggregator API (v6). Use this skill when a user wants to: 1. Build a complete swap flow: get swap calldata -> sign transaction -> broadcast to chain 2. Execute token-to-token swaps with slippage protection, MEV protection, and Jito tips (Solana) 3. Integrate OKX DEX swap + broadcast into applications, bots, or scripts This skill covers the FULL lifecycle: /swap endpoint (get tx data) + /broadcast-transaction endpoint (submit signed tx). For quote-only (no execution), use the okx-dex-quote skill instead.
---
name: article-factory-wechat
humanizer
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
tavily-search
Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.
baidu-search
Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.