Uniswap launched v4 on Ethereum mainnet in January 2025, roughly eighteen months after the original whitepaper. The headline addition was hooks: a system that lets developers attach custom smart contracts to any liquidity pool and run arbitrary logic at specific points in a trade or liquidity event.
That is a more significant change than it sounds.
What the Previous Versions Did
Uniswap v1 and v2 used a single pricing invariant: x times y equals k, where x and y are the quantities of two tokens in a pool. Every trade moves along that curve. Fees were fixed at 0.3 percent.
Uniswap v3, launched in May 2021, added concentrated liquidity. Liquidity providers could choose a specific price range to deploy capital into, rather than spreading it across the entire curve from zero to infinity. This made capital more efficient in active markets and introduced multiple fee tiers: 0.01%, 0.05%, 0.30%, and 1.00%.
The trade-off was complexity. Managing a v3 position is closer to running an options strategy than passively holding a share of a pool.
What neither v2 nor v3 allowed was programmability at the pool level. You could not change fee logic, customize what happens before or after a swap, or attach logic to liquidity events. The pool did what Uniswap Labs designed it to do, and nothing else.
What Hooks Add
Hooks are external smart contracts that a pool calls at specific lifecycle events. When you deploy a v4 pool, you can attach a hook contract to it. That contract receives callbacks at up to ten points:
- Before and after a swap
- Before and after liquidity is added
- Before and after liquidity is removed
- Before and after a donate call (a mechanism for paying fees directly to in-range LPs)
- Before and after pool initialization
Each hook function can read pool state, modify behavior, and in some cases alter the output of the operation. The address of the hook contract determines which callbacks are active: specific bits in the address map to specific hook functions. This was a deliberate design choice to prevent hooks from claiming permissions they were not deployed with.
What Hooks Enable
The most immediate application is dynamic fees. A hook can read recent price volatility, on-chain oracle data, or any other signal and adjust the swap fee in real time. Higher fees during volatile periods compensate LPs for impermanent loss risk. Lower fees during stable periods attract more volume. Fixed fee tiers were always a compromise between these competing incentives; hooks make them optional.
On-chain limit orders become straightforward. A hook can hold tokens in reserve and execute a swap when the price crosses a specified threshold, returning proceeds to the original sender. That is functionally a limit order, built on top of a continuous AMM, without requiring a separate protocol.
MEV redistribution is another use case with active development. Hooks can capture surplus generated by arbitrage and return some of it to LPs rather than allowing the full amount to flow to block builders and searchers. Several teams have published hooks that implement this using commit-reveal schemes and auction mechanisms.
Custom AMM curves are now practical. The default pool still uses the constant product formula, but a hook can implement a stableswap curve for correlated assets, a lending rate curve, or any other pricing function. The settlement layer stays with Uniswap; the math is whatever the hook developer writes.
Compliance hooks serve permissioned DeFi contexts. A hook can verify whether an address holds an on-chain attestation before allowing a swap, restricting pool access to verified participants. The base protocol remains permissionless. The restriction lives in the optional hook layer.
The Singleton Architecture
Alongside hooks, v4 introduced a singleton contract called PoolManager. In v2 and v3, every pool is its own deployed smart contract. Creating a new pool requires a new deployment, with the associated gas cost and the operational overhead of tracking separate contracts.
In v4, every pool lives inside the single PoolManager contract. Creating a new pool is a state change rather than a deployment. For multi-hop swaps, where a trade routes through two or three pools to get from one token to another, this eliminates the intermediate token transfers between pools. Tokens move once, at the end of the transaction.
The gas reduction is significant for high-frequency integrators and for protocols that create and manage pools as part of their core operations.
Flash Accounting
The third architectural change is flash accounting. In v2 and v3, each operation settled immediately: tokens moved in and out with every swap or liquidity change. In v4, the contract tracks balances as running deltas within a transaction and settles at the very end.
A complex operation, such as a swap followed by a liquidity rebalance followed by another swap, completes all intermediate steps before any tokens actually transfer. The net position settles once. This reduces the number of token transfers per transaction and enables new patterns for protocols building on Uniswap’s liquidity.
What Has Been Built
The hook ecosystem is early but producing real deployments. Bunni v2, a liquidity management protocol, uses v4 hooks to implement custom fee logic and out-of-range liquidity strategies. Several projects have shipped dynamic fee hooks reading volatility data from Chainlink feeds. Angstrom, a protocol developed by researchers focused on MEV mitigation, integrates with v4 at the pool level using hooks to enforce auction-based ordering of swaps.
The Uniswap Foundation has run grant programs specifically targeting hook development. The long-term bet is that a mature ecosystem of specialized hooks creates switching costs that the earlier versions never had. Protocols and developers building on a specific hook have an incentive to stay within the Uniswap v4 ecosystem.
The Risk Layer
Hooks introduce a new attack surface. The base PoolManager contract is audited and immutable, but the hook contracts attached to individual pools are deployed by arbitrary developers. A malicious or buggy hook can manipulate pool behavior, extract value from LPs, or enable novel front-running strategies.
Users and LPs need to evaluate hook contract risk the same way they evaluate any DeFi smart contract. The community has begun building auditing standards and verification tools for hooks, but norms are still forming. Until they solidify, hooks add a layer of complexity that unsophisticated LPs may not be positioned to evaluate.
The permissionless deployment model means anyone can create a pool with any hook. Most will be benign. Some will not be.
The Competitive Angle
Uniswap has maintained a dominant position in spot DEX volume on Ethereum and the broader L2 ecosystem through multiple market cycles. But competing AMMs have taken meaningful share on specific chains: Trader Joe on Avalanche, Orca on Solana, Aerodrome on Base.
Hooks give Uniswap a platform argument alongside its protocol argument. Instead of competing feature by feature with specialized AMMs, Uniswap can host specialized behavior inside its own pools. A stableswap curve for a correlated pair does not require migrating to Curve if a v4 hook implements the same math in a Uniswap pool on the same chain.
Whether that argument holds depends on how quickly the hook development community matures and how completely the major L2s deploy v4. The core architecture is in place. The execution is still in progress.