What Is Uniswap V4? Hooks and Custom Pools Explained
Uniswap V4 explained: how hooks let developers customize pool behavior, add dynamic fees, and cut gas costs for swaps and liquidity.
Uniswap V4 is an upgrade to the Uniswap decentralized exchange that introduces "hooks" — small pieces of custom code that plug into a liquidity pool's lifecycle — along with a singleton contract design that cuts the gas cost of creating and interacting with pools. Together these changes turn Uniswap from a fixed-function AMM into a programmable base layer that developers can extend without forking the whole protocol.
From fixed pools to programmable pools
Uniswap V2 and V3 pools do exactly one thing: swap according to a constant-product (V2) or concentrated-liquidity (V3) formula, with a fixed fee tier chosen at pool creation. If a developer wanted different behavior — dynamic fees, an on-chain limit order, a custom oracle, or a way to auto-compound fees back into the position — they had to build a separate protocol on top of, or beside, Uniswap.
V4 changes this by letting a pool creator attach a hook contract that runs custom logic at defined points: before/after a swap, before/after liquidity is added or removed, and before/after pool initialization. The pool itself still executes the underlying DEX swap math, but the hook can modify fees, redirect part of a swap, restrict who can trade, or take actions like reinvesting fees automatically.
What hooks actually enable
Some examples of pool behavior hooks can implement:
- Dynamic fees that rise during high volatility and fall during calm markets, instead of a fixed 0.05%/0.3%/1% tier.
- On-chain limit orders, where liquidity is placed at a single tick and automatically "fills" as the price crosses it.
- Automated position management, so a liquidity provider's range rebalances itself rather than sitting idle once price moves out of range — directly relevant to anyone managing impermanent loss.
- Custom oracles, such as time-weighted average price feeds tuned for a specific use case rather than the default.
- Access-controlled pools, for pools that only permit certain wallets or require a KYC check — a feature aimed at institutional and RWA use cases like tokenized treasuries.
Because hooks are just contracts that implement a defined interface, anyone can write one, and pools compete on whichever hook logic attracts the most liquidity and volume.
The singleton architecture
V3 and earlier deployed a separate contract for every trading pair, which meant creating a new pool and routing a multi-hop swap involved several contract deployments and calls, each costing gas. V4 replaces this with a single "PoolManager" contract that holds the accounting for all pools. Swaps and liquidity actions become internal bookkeeping updates instead of separate contract calls, which Uniswap Labs estimated could cut gas costs for pool creation by well over 90% and reduce costs for multi-hop swaps meaningfully as well.
Uniswap V3 vs V4
| Aspect | Uniswap V3 | Uniswap V4 |
|---|---|---|
| Pool customization | Fixed fee tiers only | Custom hooks per pool |
| Contract architecture | One contract per pool | Singleton PoolManager |
| Gas for pool creation | Higher | Substantially lower |
| Native limit orders | Not built in | Possible via hooks |
| Dynamic fees | Not supported | Supported via hooks |
Risks that come with flexibility
Programmability cuts both ways. A hook is custom code, and custom code can have bugs or malicious logic that a standard AMM pool never exposed. A pool with an unaudited or adversarial hook could behave very differently from what its interface suggests — for example, silently redirecting a portion of trading fees, or blocking withdrawals under certain conditions.
This means the usual due-diligence questions for any DeFi protocol apply with extra weight to V4 pools: has the hook been audited, is its code verified and readable, and does its behavior match its description? A vanilla pool with no hook attached behaves like a V3-style pool and carries essentially the same risk profile as before. A pool built around an exotic hook is closer to using a brand-new, single-purpose protocol, even though it's technically running "on Uniswap."
Why this matters for liquidity providers
For LPs, hooks open strategies that used to require a separate protocol layer — automated rebalancing, fee-tier optimization, or MEV-resistant execution — but they also mean two pools for the same token pair can have meaningfully different risk and return profiles depending on which hook is attached. Comparing pools purely by advertised APY without checking the hook is a mistake similar to comparing two lending markets without checking their collateral parameters.
Bottom line
Uniswap V4's hooks turn a fixed-function AMM into a programmable one, and the singleton design makes pool creation and swaps meaningfully cheaper. That flexibility is genuinely useful for LPs and traders, but it shifts real complexity onto pool selection: a hook is unaudited code until proven otherwise, and its logic can materially change what "providing liquidity" means for that specific pool. Read the hook, not just the fee tier, before committing capital.
Related articles
This article is for educational purposes only and is not financial advice. DeFi involves significant risk, including total loss of funds. Always do your own research.