Zeroex Swap
Skill by aviclaw
Why use this skill?
Integrate the ZeroEx Swap skill with OpenClaw to execute automated token swaps, price quotes, and gasless transactions on EVM-compatible blockchains.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aviclaw/zeroex-swapWhat This Skill Does
The ZeroEx Swap skill provides a robust interface for interacting with the 0x API directly through your OpenClaw agent. It is designed for users who need to execute token swaps on various EVM-compatible chains, with a specific focus on high-efficiency, low-slippage trading. The skill abstracts away the complexities of the 0x v2 API, allowing your agent to fetch real-time price quotes and execute on-chain transactions seamlessly. It handles both standard transactions and advanced gasless (meta-transaction) flows, making it an essential tool for automated portfolio management or decentralized finance (DeFi) operations. By integrating your private key and 0x API credentials, the agent becomes an autonomous market participant, capable of executing complex swap logic without manual intervention.
Installation
To integrate this skill into your environment, first ensure you have the OpenClaw CLI installed. Navigate to your project directory and run: clawhub install openclaw/skills/skills/aviclaw/zeroex-swap. After installation, you must configure your environment variables. Open your terminal and export the necessary credentials: export ZEROEX_API_KEY="your-0x-api-key" and export PRIVATE_KEY="your-private-key-hex". Optionally, you can define RPC_URL to point to a specific provider like Infura or Alchemy to ensure reliable blockchain interaction. Once set, the skill is initialized and ready for command invocation.
Use Cases
This skill is ideal for several DeFi automation scenarios. First, it enables automated rebalancing of a user's wallet based on portfolio thresholds. Second, it facilitates decentralized exchange (DEX) arbitrage, where the agent monitors price discrepancies across different pools and executes swaps to capture profit. Third, it is perfectly suited for "gasless" user onboarding, where a user can perform swaps without holding native chain tokens for gas, as the agent leverages 0x's meta-transaction infrastructure to submit signed payloads on the user's behalf. It is also highly effective for simple, intent-based trading, allowing users to express "buy 100 USDC with ETH" in natural language.
Example Prompts
- "OpenClaw, please fetch a quote to swap 0.5 ETH for USDC on the Base network and tell me the expected output amount."
- "Execute a swap of 500 USDC for WETH on Base using the ZeroEx swap tool."
- "Check if a gasless swap is available for trading my remaining WETH for USDC and display the estimated gas impact."
Tips & Limitations
Security is paramount. Never use a wallet containing significant funds for agent-based automation; always use a dedicated hot wallet with limited liquidity. The skill currently relies on the 0x v2 API; ensure your API key has sufficient limits. Be mindful of slippage settings—the skill provides raw access, so confirm all parameters before execution. Lastly, meta-transactions require a signature step; ensure your environment can handle the EIP-712 signing process correctly. Always verify the RPC_URL is healthy to prevent transaction failures during market volatility.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aviclaw-zeroex-swap": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, external-api, code-execution
Related Skills
lighter
Interact with Lighter protocol - a ZK rollup orderbook DEX. Use when you need to trade on Lighter, check prices, manage positions, or query account data.
slither-audit
Run slither static analysis on Solidity contracts. Fast, lightweight security scanner for EVM smart contracts.
Agent Security Auditor
Skill by aviclaw
solidity-guardian
Smart contract security analysis skill. Detect vulnerabilities, suggest fixes, generate audit reports. Supports Hardhat/Foundry projects. Uses pattern matching + best practices from Trail of Bits, OpenZeppelin, and Consensys.
x-research
General-purpose X/Twitter research agent. Searches X for real-time perspectives, dev discussions, product feedback, cultural takes, breaking news, and expert opinions. Works like a web research agent but uses X as the source. Use when: (1) user says "x research", "search x for", "search twitter for", "what are people saying about", "what's twitter saying", "check x for", "x search", "/x-research", (2) user is working on something where recent X discourse would provide useful context (new library releases, API changes, product launches, cultural events, industry drama), (3) user wants to find what devs/experts/community thinks about a topic. NOT for: posting tweets, account management, or historical archive searches beyond 7 days.