Uniswap v4 Core: Automated market maker protocol
Core smart contracts for Uniswap v4's extensible and customizable automated market maker pools.
Learn more about Uniswap v4 Core
Uniswap v4 Core is an automated market maker protocol that provides extensible and customizable liquidity pools. The system uses a singleton-style architecture where all pool state is managed in the PoolManager.sol contract, with pool actions executed through an unlock/callback pattern. The protocol supports customizable hook contracts that can execute callbacks during pool lifecycle events like swaps, liquidity modifications, and donations. It is designed for creating decentralized exchange functionality with flexible integration patterns for developers.
Singleton Architecture
All pool state is managed in a single PoolManager contract, with actions executed through an unlock/callback pattern that tracks net balance deltas.
Customizable Hooks
Pools can be initialized with hook contracts that implement callbacks during pool lifecycle events, providing extensible functionality.
Flexible Integration
The unlock and call style architecture allows multiple pool actions within a single transaction as long as net deltas reach zero.
import {IPoolManager} from 'v4-core/contracts/interfaces/IPoolManager.sol';
import {IUnlockCallback} from 'v4-core/contracts/interfaces/callback/IUnlockCallback.sol';
contract MyContract is IUnlockCallback {
IPoolManager poolManager;
function doSomethingWithPools() {
// this function will call `unlockCallback` below
poolManager.unlock(...);
}
function unlockCallback(bytes calldata data) external returns (bytes memory) {
// disallow arbitrary caller
if (msg.sender != address(poolManager)) revert Unauthorized();
// perform pool actions
poolManager.swap(...)
}
}
error Unauthorized();Top in Crypto
Related Repositories
Discover similar tools and frameworks used by developers
Hardhat
Development environment for compiling, deploying, testing, and debugging Ethereum smart contracts and dApps.
Solmate
A collection of gas-optimized Solidity contracts including ERC token implementations and utility libraries.
rippled
C++ XRP Ledger implementation operating as a P2P node for transaction processing and consensus.
Solana Explorer
Web application for exploring Solana blockchain transactions, accounts, blocks, and on-chain data.
Lotus
Go-based reference implementation of the Filecoin distributed storage network protocol.
Related Reading
Guides and comparisons from the Greptile content library
Choosing the Right Code Review Tool: Better Alternatives to Graphite AI
A breakdown of the best alternatives to Graphite for code reviews. Compare AI tools like Trag, open-source solutions like Gerrit, and database-focused platforms like Visual Expert.
9 Best Pull Request Automation Tools [2026]
Nine pull request automation tools compared on features, use cases, pricing, and user feedback, so you can work out which one closes the gap between how fast your team writes code and how fast it can review it.
What is Source Code Management (SCM): Everything Engineering Leaders Need to Know
Source code management is more than branching and merging. Here is how SCM works, the top tools, the best practices, and why good code review is the foundation of source control in an agentic era.
What is Shift Left Testing? Everything Engineering Leaders Need to Know
The five types of shift-left testing, the benefits and limitations of each, and how the approach changes when agents write and review a growing share of your code.