skills/trade-tokens/SKILL.md
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", "swap tokens", "trade USDC for WETH".
npx skillsauth add agnicpay/agnic-wallet-skills trade-tokensInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use the npx agnic@latest trade command to swap tokens on Base network. You must be authenticated to trade.
npx agnic@latest status
If the wallet is not authenticated, refer to the authenticate-wallet skill.
npx agnic@latest trade <amount> <from> <to> [options]
| Argument | Description |
| -------- | ---------------------------------------------------------------------- |
| amount | Amount to swap (see Amount Formats below) |
| from | Source token: alias (usdc, eth, weth) or contract address (0x...) |
| to | Destination token: alias (usdc, eth, weth) or contract address (0x...) |
| Format | Example | Description |
| ------------- | ---------------------- | -------------------------------------- |
| Dollar prefix | '$1.00', '$0.50' | USD notation (decimals based on token) |
| Decimal | 1.0, 0.50, 0.001 | Human-readable with decimal point |
| Whole number | 5, 100 | Interpreted as whole tokens |
| Atomic units | 500000 | Large integers treated as atomic units |
Auto-detection: Large integers without a decimal point are treated as atomic units. For example, 500000 for USDC (6 decimals) = $0.50.
IMPORTANT: Always single-quote amounts that use $ to prevent bash variable expansion (e.g. '$1.00' not $1.00).
| Alias | Token | Decimals | Address | | ----- | ----- | -------- | ------------------------------------------ | | usdc | USDC | 6 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | | eth | ETH | 18 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE | | weth | WETH | 18 | 0x4200000000000000000000000000000000000006 |
| Option | Description |
| -------------------- | --------------------------------------------- |
| -s, --slippage <n> | Slippage tolerance in basis points (100 = 1%) |
| --json | Output result as JSON |
Before constructing the command, validate all user-provided values to prevent shell injection:
^\$?[\d.]+$ (digits, optional decimal point, optional $ prefix). Reject if it contains spaces, semicolons, pipes, backticks, or other shell metacharacters.usdc, eth, weth) or a valid 0x hex address (^0x[0-9a-fA-F]{40}$). Reject any other value.^\d+$).Do not pass unvalidated user input into the command.
# Swap $1 USDC for ETH (dollar prefix — note the single quotes)
npx agnic@latest trade '$1' usdc eth
# Swap 0.50 USDC for ETH (decimal format)
npx agnic@latest trade 0.50 usdc eth
# Swap 0.01 ETH for USDC
npx agnic@latest trade 0.01 eth usdc
# Swap with custom slippage (2%)
npx agnic@latest trade '$5' usdc eth --slippage 200
# Get JSON output
npx agnic@latest trade '$1' usdc eth --json
npx agnic@latest status to check)Common errors:
npx agnic@latest auth login firsttools
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...", "transfer to vitalik.eth", "tip someone", "send USDC".
development
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".
development
Make paid requests to x402-enabled APIs using USDC. Use when you or the user want to call a paid API, make an x402 payment, use a bazaar service, or pay for an API request. Covers phrases like "call this API", "use this service", "pay for the request", "make a paid call", "fetch from x402 endpoint".
development
Check your agent's on-chain ERC-8004 identity, trust score, and KYA credentials. Use when you or the user want to see agent identity, check trust score, view KYA credentials, or check agent status. Covers phrases like "what's my agent ID", "check trust score", "show my identity", "agent status", "KYA credentials".