Skip to content

feat: add Uniswap V4 action provider#951

Open
guglxni wants to merge 4 commits intocoinbase:mainfrom
guglxni:feat/uniswap-v4-action-provider
Open

feat: add Uniswap V4 action provider#951
guglxni wants to merge 4 commits intocoinbase:mainfrom
guglxni:feat/uniswap-v4-action-provider

Conversation

@guglxni
Copy link

@guglxni guglxni commented Feb 13, 2026

Closes #952

Summary

Summary

Add a new action provider enabling AI agents to interact with Uniswap V4's singleton PoolManager architecture.

Motivation

Uniswap V4 is the latest version of the Uniswap protocol, featuring:

  • Singleton PoolManager architecture (all pools in one contract)
  • ~30% gas savings over V3
  • Native ETH support (no WETH wrapping)
  • Hooks system for customizable pool behavior
  • Flash accounting for efficient multi-hop swaps

AgentKit currently has no Uniswap integration, and V4 is the production version deployed on Base Mainnet.

Proposed Actions

Action Description
get_v4_quote Get a price quote for a token swap without executing
swap_exact_input Execute a swap with an exact input amount
swap_exact_output Execute a swap specifying the desired output amount

Supported Networks

  • Base Mainnet (base-mainnet)
  • Base Sepolia (base-sepolia)

Implementation

  • Verified contract addresses from official Uniswap V4 deployment docs
  • Proper sqrt price limit handling (MIN/MAX_SQRT_RATIO)
  • 109 passing tests across 3 test suites
  • Full documentation

Additional Context

All contract addresses sourced from https://docs.uniswap.org/contracts/v4/deployments

@guglxni guglxni requested a review from murrlincoln as a code owner February 13, 2026 19:34
@cb-heimdall
Copy link

cb-heimdall commented Feb 13, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Feb 13, 2026
guglxni and others added 4 commits February 14, 2026 01:21
Add Uniswap V4 swap functionality with the following features:
- get_v4_quote: Get price quotes for token swaps
- swap_exact_input: Execute swaps with exact input amount
- swap_exact_output: Execute swaps with exact output amount

Supports Base and Base Sepolia networks using Universal Router
architecture. Includes automatic ERC20 approvals, slippage
protection, and native ETH support.

Co-authored-by: guglxni <your-email@example.com>
- Add quoteExactOutputSingle to QUOTER_ABI for accurate input estimation
- Implement proper balance checks before swapExactOutput execution
- Fix infinite approval bug - now only approves maxInputAmount with slippage
- Add slippage validation (0.01% to 50%) in schemas
- Add EIP-55 checksum address validation using viem's getAddress
- Add comprehensive security-focused unit tests
- Fixes FINDING-001, FINDING-002, FINDING-003, FINDING-005, FINDING-010

All 41 tests passing
- Fix network ID from 'base' to 'base-mainnet' per agentkit convention
- Update all contract addresses to verified values from Uniswap V4 docs
- Fix sqrtPriceLimitX96 from 0n to proper MIN/MAX_SQRT_RATIO limits
- Add MIN_SQRT_RATIO and MAX_SQRT_RATIO constants
- Fix prettier/eslint formatting issues
- Update test mock network IDs and assertions
- Add Uniswap V4 provider listing to main README
- Update provider README with correct addresses and network IDs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

feat: Add Uniswap V4 action provider

2 participants