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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aaronllee/easy-swapWhat This Skill Does
The okx-dex-swap skill is a specialized agentic capability designed to automate the entire lifecycle of on-chain token swaps. Unlike quote-only tools, this skill manages the complex orchestration of interacting with the OKX DEX Aggregator API (v6). It fetches transaction calldata for optimal swap routes and enables the submission of signed transactions directly to the blockchain. By leveraging this skill, you can automate token-to-token swaps while maintaining robust security via slippage protection, MEV-resistance mechanisms, and optional Jito tip support for high-priority transactions on the Solana network. It simplifies the developer experience by abstracting the handshake between API data retrieval and transaction broadcasting.
Installation
To add this skill to your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/aaronllee/easy-swap
Ensure you have configured your environment variables, including OKX_ACCESS_KEY, OKX_SECRET_KEY, and OKX_PASSPHRASE. For transaction signing, verify that your local environment includes necessary libraries such as web3.py or ethers.js for EVM chains, and solders or @solana/web3.js for Solana transactions.
Use Cases
- Automated Trading Bots: Build scripts that respond to market price changes by triggering immediate swaps on decentralized exchanges without manual intervention.
- DeFi Portfolio Rebalancing: Programmatically swap high-volatility assets into stablecoins when specific portfolio allocation thresholds are breached.
- Cross-Chain Aggregation: Integrate liquidity sourcing across multiple chains into a single interface for seamless asset conversion.
- Yield Farming Entry: Quickly swap base tokens into liquidity pool tokens to maximize yield opportunities during high-demand windows.
Example Prompts
- "Swap 500 USDT for ETH on Ethereum using the OKX DEX aggregator, ensuring slippage is set to 0.5% and apply MEV protection."
- "Perform an exactIn swap of 10 SOL to USDC on the Solana network; please include a Jito tip to ensure the transaction hits the next block."
- "Execute a swap of 2000 DAI to LINK on BSC, use my current wallet address for signing, and confirm the transaction broadcast status once complete."
Tips & Limitations
- Slippage Management: Always define a reasonable slippage tolerance. Excessive slippage increases the risk of front-running, while too low may cause transactions to revert.
- Wallet Security: Never hardcode your private keys in scripts; use environment-based secrets or hardware wallets for signing.
- Pre-check Approval: Remember that for ERC-20 tokens, you must have approved the router contract to spend your tokens before the swap can succeed.
- Gas Estimates: While the OKX API provides optimized routes, network congestion can still impact execution speed. Ensure sufficient native gas tokens are available in your wallet to cover the final broadcast cost.
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-aaronllee-easy-swap": {
"enabled": true,
"auto_update": true
}
}
}Tags
Flags: network-access, external-api, code-execution
Related Skills
iseclaw-intel
Indonesian Web3 intelligence via Iseclaw ACP agent. Real-time market data, token signals, TGE research, and GameFi analysis from Southeast Asia's first transparent AI agent.
Zerion Api Skill
Skill by abishekdharshan
web3-weekly-report
自动抓取数据并生成 Web3 行业资本运作周报,涵盖融资事件、监管动态、上市公司 DAT 动态、并购交易与 RWA 项目追踪。当用户提到"写周报"、"生成周报"、"整理本周融资"、"Web3 周报"、"资本运作周报"、"采编周报",或请求整理加密行业本周动态时,立即激活此 skill。即使用户只说"帮我写本周的",只要上下文涉及 Web3、加密、融资、RWA、DAT,也应激活。
okx-dex-quote
Fetch optimal swap quotes from OKX DEX Aggregator API (v6). Use this skill when a user wants to: 1. Get the best price for swapping tokens on any supported EVM/Solana chain 2. Compare DEX routing paths and price impact for token swaps 3. Build applications or scripts that query real-time DEX aggregator pricing Core value: Generates correct, authenticated API calls with proper token decimals, amount formatting, HMAC-SHA256 signing, and comprehensive error handling.
Zerion Api
Skill by abishekdharshan