trade
Swap or trade tokens on Base network. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and WETH. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH".
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/0xrag/tradeWhat This Skill Does
The trade skill provides a direct, terminal-based interface to perform token swaps on the Base network via the CDP Swap API. It abstracts away the complexities of smart contract interactions, allowing you to convert between native assets like ETH and tokens like USDC seamlessly. The skill supports multiple input formats for token amounts—ranging from human-readable dollar amounts and decimals to raw atomic units—ensuring flexibility for both casual users and developers. It is built to integrate directly into the OpenClaw agent workflow, requiring prior authentication via the authenticate-wallet skill to ensure secure transactions.
Installation
To integrate this skill into your local OpenClaw environment, use the built-in installer provided by the skill author:
clawhub install openclaw/skills/skills/0xrag/trade
Once installed, ensure your wallet is initialized and authorized by running npx awal@latest status. If your session has expired or the wallet is not configured, execute the authentication flow before attempting to initiate any swaps.
Use Cases
This skill is designed for rapid asset management within the Base ecosystem. Use it when you need to rebalance your portfolio, acquire tokens for gas or protocol interactions, or cash out rewards. Common scenarios include:
- Purchasing ETH to cover gas fees for other network activities.
- Swapping USDC into WETH to participate in liquidity provision or lending protocols.
- Automating exit strategies by converting volatile assets into stablecoins like USDC during market volatility.
- Integrating token swapping into broader automated agent workflows or scripts.
Example Prompts
- "Swap 50 USDC for ETH to cover my gas costs on Base."
- "Convert my 0.5 ETH into USDC so I can lock in some profits."
- "I need to get some WETH; please trade $10 worth of USDC for it."
Tips & Limitations
- Safety Note: Always verify the chain before swapping. While the default is Base, you can specify
-c <network>if supporting multi-chain configurations in the future. - Precision: When using the dollar prefix, ensure you wrap the amount in single quotes (e.g.,
'$1.00') to prevent your shell from interpreting the$sign as a variable. - Slippage: For large trades, use the
-sflag to define your slippage tolerance in basis points to avoid suboptimal execution. 100 basis points equals 1% slippage tolerance. - Authentication: This skill does not manage wallet keys itself; it relies on the pre-authenticated session state. If you encounter a permission error, check your session status immediately.
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-0xrag-trade": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, external-api
Related Skills
search-for-service
Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar".
fund
Add money to the wallet. Use when you or the user want to fund, deposit, top up, load, buy USDC, add funds, onramp, or get USDC. Also use when the wallet has insufficient balance for a send or trade operation, or when someone asks "how do I get USDC?"
send-usdc
Send USDC to an Ethereum address or ENS name. Use when you or the user want to send money, pay someone, transfer USDC, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", or "transfer to vitalik.eth".
monetize-service
Build and deploy a paid API that other agents can pay to use via x402. Use when you or the user want to monetize an API, make money, earn money, offer a service, sell a service to other agents, charge for endpoints, create a paid endpoint, or set up a paid service. Covers "make money by offering an endpoint", "sell a service", "monetize your data", "create a paid API".
x402
Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services.