swap-tokens

Generate server-side token swap code using Circle App Kit or Swap Kit SDKs.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/Surojit012/CMO --skill swap-tokens-surojit012
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swap-tokens
Source: https://github.com/Surojit012/CMO/tree/main/.agents/skills/swap-tokens
Command: npx skills add https://github.com/Surojit012/CMO --skill swap-tokens-surojit012

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @circle-fin/app-kit, @circle-fin/swap-kit, @circle-fin/adapter-viem-v2, @circle-fin/adapter-solana-kit, @circle-fin/adapter-circle-wallets, viem, @solana/kit, @solana/web3.js, and includes references (resource) components.

What problem does it solve? Building token swap functionality with Circle's App Kit or Swap Kit SDKs requires choosing the right SDK, wallet adapter, and chain configuration while handling real mainnet funds safely. This Skill guides the AI through a structured decision process and generates correct, security-conscious swap code. ## Core Features & Use Cases - SDK and Adapter Selection: Walks through a decision guide to choose between App Kit (swap + bridge + send) and standalone Swap Kit, plus the right wallet adapter (Viem, Solana Kit, or Circle Wallets). - Swap Implementation Patterns: Generates code for same-chain swaps, rate estimation via estimateSwap, slippage and stop-limit configuration, and custom developer fee collection. - Cross-Chain Token Movement: Implements multi-step swap + bridge + swap patterns using App Kit for moving tokens across chains via USDC. - Use Case: A developer wants to convert USDT to USDC on Ethereum from a backend service. The Skill confirms chain, tokens, and amount, then generates a Viem-adapter swap script with proper slippage protection and error handling. ## Quick Start Ask the assistant to build a token swap that converts USDT to USDC on Ethereum using Circle App Kit, and answer its questions about SDK choice and wallet management.

Frequently Asked Questions about swap-tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I swap tokens with Circle App Kit?

Install @circle-fin/app-kit with a wallet adapter like @circle-fin/adapter-viem-v2, create a kit key in the Circle Developer Console, then call kit.swap() with the chain, tokenIn, tokenOut, amountIn, and config containing your kit key. All swap code runs server-side only.

Circle App Kit vs Swap Kit: which should I use?

Use App Kit if you may need bridge or send functionality later, since it covers swap, bridge, and send in one package. Choose standalone Swap Kit only when you explicitly want swap-only functionality in a lighter package.

Which chains and tokens does Circle swap support?

Swaps run on mainnet chains including Ethereum, Base, Arbitrum, Solana, Polygon, and others, plus Arc Testnet. Supported token aliases include USDC, EURC, USDT, PYUSD, DAI, WBTC, WETH, and WSOL, or any token by contract address.

Can I use Circle swap SDKs in browser or client-side code?

No. Both App Kit and Swap Kit require a kit key, which is a server-side-only credential that must never be exposed to browsers. Client-side wallet connections like wagmi or ConnectKit are not supported for swaps.

How do I protect a swap from price changes?

Set slippageBps for a relative tolerance (default 300 bps) or stopLimit for an absolute minimum output amount. When both are set, stopLimit takes precedence. Always call estimateSwap first to preview expected output.

How do I move tokens cross-chain with Circle SDKs?

Use App Kit to combine swap and bridge calls: swap the source token to USDC, bridge USDC to the destination chain, then optionally swap to the target token. Standalone Swap Kit cannot bridge, so App Kit is required.