Skip to content
Skill

Swap integration

Guides an agent through integrating Uniswap token swaps into apps, bots and contracts

Swap integration is an open-source agent skill for finance and payments. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
236
Last commit
License
MIT
Listing updated

Similar skills

About Swap integration

This skill helps an AI coding agent add Uniswap token swapping to a frontend, a backend script or a smart contract. It points the agent to the Trading API for most app and bot work, and to direct Universal Router calls or the Universal Router SDK when the project needs lower-level control over routing and transaction construction.

The guidance walks through the Trading API request flow: an optional permission check for permissioned pools, a token approval check, a quote, and then building the swap transaction. It also covers Permit2 signing versus direct approvals, validating swap responses before broadcasting, handling UniswapX and classic routes differently, and proxying API calls from browsers. It includes wagmi and viem examples for wallet interaction.

The skill expects a project that uses JavaScript or TypeScript with viem or wagmi, a Uniswap Developer Portal API key stored in an environment variable, and the ability to ask the user for confirmation before any transaction is sent. It ships no scripts of its own; the agent writes the code.

When your agent uses it

Integrate Uniswap swaps into applications. Use when user says "integrate swaps", "uniswap", "trading api", "add swap functionality", "build a swap frontend", "create a swap script", "smart contract swap integration", "use Universal Router", "Trading API", or mentions swapping tokens via Uniswap.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (75 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the uniswap-trading plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add Uniswap/uniswap-ai
/plugin install uniswap-trading@uniswap-ai

Or copy only this skill to ~/.claude/skills/swap-integration:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swap-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/swap-integration" ~/.claude/skills/swap-integration &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/swap-integration inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/swap-integration to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swap-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/swap-integration" ~/.agents/skills/swap-integration &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/swap-integration inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/swap-integration to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swap-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/swap-integration" ~/.cursor/skills/swap-integration &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/swap-integration inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/Uniswap/uniswap-ai.git --path packages/plugins/uniswap-trading/skills/swap-integration

Or copy the folder to ~/.gemini/skills/swap-integration yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/swap-integration:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swap-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/swap-integration" ~/.copilot/skills/swap-integration &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/swap-integration inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git

Then copy uniswap-ai/packages/plugins/uniswap-trading/skills/swap-integration into your agent's skills folder as swap-integration. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Trading API workflow
Step-by-step calls for approval checks, quotes and swap transaction creation.
Universal Router guidance
Command encoding, SDK usage and manual route building for direct contract calls.
Permit2 handling
Rules for signatures and permit data across classic and UniswapX routes.
Permissioned pool checks
A pre-check to see whether a wallet may trade a restricted token.
Browser and wallet setup
Buffer polyfills, CORS proxy configs and wagmi v2 client patterns.
Input and transaction safeguards
Address and amount validation, API key handling and user confirmation before sending transactions.

Good for

  • Add a token swap widget to a React or Next.js app
  • Write a Node.js script that swaps tokens on Ethereum
  • Build a trading bot that quotes and executes Uniswap swaps
  • Call the Universal Router from a smart contract
  • Check whether a wallet can trade a permissioned token before quoting

Swap integration FAQ

What does the skill need before Swap integration can be used?

A Uniswap Developer Portal API key for the Trading API, supplied through an environment variable. The examples use viem, and browser apps need a Buffer polyfill and an API proxy.

Does Swap integration send transactions automatically?

No. The guidance requires the agent to show the transaction summary and get explicit user approval before any transaction that spends gas or moves tokens is sent.

Which routing types does Swap integration cover?

It covers CLASSIC AMM swaps, UniswapX Dutch auction routes such as DUTCH_V2 and PRIORITY, and wrap and unwrap operations, with notes on how each returns its quote.

Which chains are supported?

The skill points to the official Uniswap supported chains list rather than listing chains itself, and notes that UniswapX V2 orders run on Ethereum, Arbitrum, Base and Unichain.

How do I install Swap integration in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/swap-integration to use it in all your projects, or to .claude/skills/swap-integration in one project. Or install the uniswap-trading plugin, which includes it: /plugin marketplace add Uniswap/uniswap-ai, then /plugin install uniswap-trading@uniswap-ai.

Does Swap integration run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Swap integration?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Swap integration?

The closest alternatives to Swap integration are V4 SDK integration, Swap tokens, Swap planner, Copy trade and Pump swap SDK.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from Uniswap/uniswap-ai

  1. Guides your agent through configuring Uniswap CCA token auction contract parameters

    • Open source
    • 236 GitHub stars
    • Finance and payments
  2. Guides an agent through deploying Uniswap CCA auction contracts via the factory

    • Open source
    • 236 GitHub stars
    • Developer tools
  3. Plans Uniswap liquidity positions and generates pre-filled position deep links

    • Open source
    • 236 GitHub stars
    • Finance and payments
  4. Plans token swaps on Uniswap across chains and builds pre-filled swap links

    • Open source
    • 236 GitHub stars
    • Finance and payments
  5. Guides an agent to scaffold Uniswap v4 hook contracts via the OpenZeppelin Wizard MCP

    • Open source
    • 236 GitHub stars
    • Developer tools
  6. Security checklists and vulnerability patterns for building Uniswap v4 hooks safely

    • Open source
    • 236 GitHub stars
    • Developer tools