Skip to content
Skill

V4 SDK integration

Guides an agent through building Uniswap v4 swap and liquidity code with the SDKs

V4 SDK integration is an open-source agent skill for developer tools. 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 V4 SDK integration

This skill gives an agent a reference for application-layer work against Uniswap v4 using the v4 SDK and Universal Router rather than the Trading API. It explains how v4 differs from v3: a singleton PoolManager, swaps routed through the Universal Router with V4Planner and RoutePlanner, pool state read from a StateView contract, and liquidity managed through PositionManager multicalls. A contract address table and a per-chain deployments link are included, since addresses vary by network.

The guide covers the swap pattern for single-hop and multi-hop exact-input trades, including the swap config shape and the Permit2 approval sequence required for ERC20 tokens. It also covers quoting through simulated eth_call rather than a transaction, with examples for viem, ethers v6 and ethers v5, and shows how to read slot0 and liquidity for a pool ID computed with Pool.getPoolId. Position examples show adding liquidity with native ETH handling. A short list of strict rules flags common mistakes such as calling PoolManager directly or omitting deadlines.

The skill expects a TypeScript or JavaScript project and installs @uniswap/v4-sdk, @uniswap/sdk-core and @uniswap/universal-router-sdk. It assumes a viem-based stack for most examples and links to Uniswap's SDK documentation for further detail. It contains no scripts of its own.

When your agent uses it

App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.

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 1 file (11 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/v4-sdk-integration:

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

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

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/v4-sdk-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/v4-sdk-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/v4-sdk-integration" ~/.agents/skills/v4-sdk-integration &&
rm -rf "$tmp"

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

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/v4-sdk-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/v4-sdk-integration &&
cp -R "$tmp/packages/plugins/uniswap-trading/skills/v4-sdk-integration" ~/.cursor/skills/v4-sdk-integration &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/v4-sdk-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/v4-sdk-integration

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

Gemini CLI docs on skills

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

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

For one project only, put the folder in .github/skills/v4-sdk-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/v4-sdk-integration into your agent's skills folder as v4-sdk-integration. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Swap execution via Universal Router
Shows how to plan single-hop and multi-hop exact-input swaps through V4Planner and the Universal Router.
Quoting with simulated calls
Explains how to fetch quotes through eth_call across viem and ethers versions, including the four quoter methods.
Pool state reads
Covers reading slot0 and liquidity from StateView using a computed pool ID.
Liquidity position management
Describes adding, removing, collecting and creating positions with PositionManager multicalls.
Permit2 approval flow
Lays out the two-step token approval needed for ERC20 swaps in v4.
v3 to v4 differences
Compares contract architecture, native ETH handling, fee collection and position discovery between v3 and v4.

Good for

  • Build a token swap interface on top of Uniswap v4 pools
  • Show a live quote before a v4 trade is submitted
  • Add or remove liquidity from a v4 position in a dApp
  • Read the current price and liquidity of a v4 pool
  • Route a multi-hop swap through several v4 pools

V4 SDK integration FAQ

What does V4 SDK integration need to run?

It targets TypeScript or JavaScript projects and uses the @uniswap/v4-sdk, @uniswap/sdk-core and @uniswap/universal-router-sdk packages, with most examples written for viem.

When should I use V4 SDK integration instead of the Trading API guide?

It is for building swap and liquidity experiences directly with the v4 SDK; the Trading API and v3-centric swaps are covered by a separate swap-integration skill.

Does V4 SDK integration include Solidity hook contracts?

No. Solidity hook contract work is handled by the separate uniswap-hooks skill.

Are the contract addresses the same on every chain?

No. The skill states that v4 addresses differ per chain and points to Uniswap's deployments page, except Permit2 which is listed as the same across chains.

How do I install V4 SDK integration in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/v4-sdk-integration to use it in all your projects, or to .claude/skills/v4-sdk-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 V4 SDK 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 V4 SDK 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 V4 SDK integration?

The closest alternatives to V4 SDK integration are Swap integration, Lp integration, V4 security foundations, Permissioned pools deployer and V4 hook generator.

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