# Swap integration

> Swap integration is an open-source agent skill for finance and payments. Guides an agent through integrating Uniswap token swaps into apps, bots and contracts. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/Uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/swap-integration
- **Repository:** https://github.com/uniswap/uniswap-ai
- **GitHub stars:** 236
- **License:** MIT
- **Skill name:** swap-integration
- **Collection:** https://github.com/Uniswap/uniswap-ai
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments)
- **Listing updated:** 2026-12-02

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/swap-integration)
- [Asks for: Read, Write, Edit, Glob, Grep, Bash(npm:*), Bash(npx:*), Bash(yarn:*)…](https://github.com/Uniswap/uniswap-ai/blob/HEAD/packages/plugins/uniswap-trading/skills/swap-integration/SKILL.md)
- [License: MIT](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-trading/skills/swap-integration)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [V4 SDK integration](https://ai-powered.com/skills/v4-sdk-integration): V4 SDK integration is an open-source agent skill for developer tools.
- [Swap tokens](https://ai-powered.com/skills/swap-tokens): Swap tokens is an open-source agent skill for finance and payments.
- [Swap planner](https://ai-powered.com/skills/swap-planner): Swap planner is an open-source agent skill for finance and payments.
- [Copy trade](https://ai-powered.com/skills/copy-trade): Copy trade is an open-source agent skill for finance and payments.
- [Pump swap SDK](https://ai-powered.com/skills/pump-swap-sdk): Pump swap SDK is an open-source agent skill for finance and payments.
- [Trust wallet API](https://ai-powered.com/skills/trust-wallet-api): Trust wallet API is an open-source agent skill for finance and payments.
- [Index bot](https://ai-powered.com/skills/index-bot): Index bot is an open-source agent skill for finance and payments.
- [Liquidity planner](https://ai-powered.com/skills/liquidity-planner): Liquidity planner is an open-source agent skill for finance and payments.

---
Source: https://ai-powered.com/skills/swap-integration
