coinbase / coinbase/agentkit

feat: Add Uniswap V4 action provider

Open
#952 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.3k
Forks
815
Avg merge
13h 31m
Merged PRs (30d)
2

Description

## Feature Request: Uniswap V4 Action Provider

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

PR #951 implements this feature with:
- 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.