Back to Skills

trade

Swap or trade tokens on Base or Polygon. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and POL. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH", "buy POL".

106stars38forksUpdated 5/16/2026

Security Assessment

Safe(100/100)
Security Score100/100

About trade

The 'trade' skill provides users with the ability to swap, exchange, or convert tokens on the Base and Polygon blockchains. It addresses the common challenge of managing multiple cryptocurrency tokens by offering a streamlined command-line interface to perform token trades securely and efficiently. Users can convert between popular tokens such as USDC, ETH, and POL using simple commands without needing to interact with complex decentralized finance (DeFi) protocols directly. This skill is especially useful for individuals who want quick token exchanges without navigating web interfaces or smart contract interactions manually.

The skill's primary features include support for multiple amount formats, including dollar notation, decimal numbers, whole tokens, and atomic units, allowing flexibility in specifying trade amounts. It provides input validation to ensure security by preventing shell injection, and supports both token aliases and contract addresses, automatically reading token decimals when necessary. Users can customize their trades with options such as specifying the blockchain network (Base or Polygon), setting slippage tolerance, and receiving output in JSON format. Authentication is required before executing trades to guarantee secure transactions.

Target users include cryptocurrency traders, developers, and anyone managing token portfolios on Base or Polygon who need a fast and reliable tool for token swaps. Use cases range from quickly converting USDC to ETH for investment purposes, selling ETH for POL, or performing automated trades within scripts. Its straightforward syntax, combined with input validation and alias support, makes it accessible to both technical users familiar with command-line tools and less technical users looking for precise token conversion commands.

FAQ

How do I execute a token swap using this skill?

You can execute a swap using the command `npx [email protected] trade <amount> <from> <to> [options]`. Ensure your wallet is authenticated and replace `<amount>`, `<from>`, and `<to>` with the desired values. Options include chain selection, slippage tolerance, and JSON output.

Which blockchains are supported for trading?

The skill supports token swaps on Base and Polygon blockchains. You can select the blockchain using the `-c` or `--chain` option; Base is the default.

Can I use contract addresses instead of token aliases?

Yes, you can use token contract addresses in place of aliases. The skill will automatically read the token decimals from the contract to process the trade correctly.

What input validation is performed?

The skill validates amounts to match `^\$?[\d.]+$`, ensures 'from' and 'to' tokens are either known aliases or valid 0x addresses, and checks that slippage is a positive integer. This prevents shell injection and invalid trades.

Do I need to authenticate my wallet before trading?

Yes, the wallet must be initialized and authenticated. You can check authentication using `npx [email protected] status`. If unauthenticated, follow the 'authenticate-wallet' skill instructions.

Install trade

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill