Uniswap v4 Hooks: The Complete Guide for 2026
Uniswap v4 launched in January 2025 with a feature that quietly rewrites what a DEX can be: Hooks. Instead of one fixed AMM design, any developer can now attach custom smart contract logic to individual liquidity pools — enabling dynamic fees, on-chain limit orders, MEV revenue sharing, KYC-gated pools, and much more. This guide explains exactly how Hooks work, what you can build with them, and the risks you need to understand as a DeFi user.
⚡ Uniswap v4 Key Stats (March 2026)
1. What Is Uniswap v4?
Uniswap is the largest decentralized exchange (DEX) by volume. It allows anyone to swap tokens directly from their wallet, with no sign-up, no KYC, and no custodian — just you, your wallet, and a smart contract that runs automatically. The protocol launched in November 2018 and has grown through four major versions, each adding a fundamental new primitive to how liquidity works on-chain.
Uniswap v4 launched on January 31, 2025, as the most significant architectural upgrade the protocol has ever shipped. While v3 introduced concentrated liquidity (letting LPs focus capital in specific price ranges for higher yield), v4 goes a level deeper: it turns Uniswap from a single AMM design into a platform for infinite AMM experimentation.
The key innovations are four interrelated changes: Hooks (custom smart contract extensions), a Singleton architecture (one contract for all pools), Flash Accounting (batch settlement), and native ETH support. Together they cut gas costs by up to 99% for pool creation and unlock an entirely new layer of DeFi composability.
2. What Are Hooks?
Think of Hooks as plugins for liquidity pools. A Hook is an external smart contract that gets attached to a specific Uniswap v4 pool at creation time. Once attached, the Hook's code automatically executes at defined points in the pool's lifecycle — before and after swaps, before and after liquidity changes, and when the pool is initialized.
Before v4, if you wanted to build a DEX with dynamic fees or auto-compounding liquidity, you had two bad options: fork the entire Uniswap codebase (losing its liquidity network), or build a new protocol from scratch (expensive and fragmented). Hooks solve this by giving developers standardized extension points inside Uniswap itself — you get the benefit of Uniswap's deep liquidity while adding your own logic on top.
💡 Key Concept: Hooks are Not New to Software
The concept of "hooks" (also called middleware or plugins) is a standard software pattern. WordPress plugins, React lifecycle hooks, and GitHub Actions all use the same idea: inject custom logic at predefined execution points without modifying the core system. Uniswap v4 brings this pattern to on-chain liquidity for the first time.
Each pool can have exactly one Hook contract, but a single Hook contract can serve an unlimited number of pools. This architecture keeps complexity manageable while enabling virtually unlimited customization possibilities.
3. The Hook Lifecycle Explained
Hooks can execute at up to eight points in a pool's operation. Each execution point has a "before" and "after" variant, giving fine-grained control over every pool action:
| Hook Point | When It Fires | What You Can Do |
|---|---|---|
| beforeInitialize | Before pool creation | Enforce creation conditions, whitelist deployers |
| afterInitialize | After pool creation | Set initial state, bootstrap liquidity |
| beforeAddLiquidity | Before LP deposit | Validate LP identity, apply KYC checks |
| afterAddLiquidity | After LP deposit | Issue LP receipt tokens, trigger rewards |
| beforeRemoveLiquidity | Before LP withdrawal | Apply lock-up periods, calculate exit fees |
| afterRemoveLiquidity | After LP withdrawal | Trigger auto-compound, send fee rebates |
| beforeSwap | Before each swap | Apply dynamic fees, check allowlists, run TWAMM |
| afterSwap | After each swap | Share MEV revenue, update oracles, auto-rebalance |
When a Hook executes, it can return deltas — adjustments to the token balances involved in the operation. This "custom accounting" mechanism lets Hooks take fees from swaps, override default pricing, or even route flows to entirely different protocols mid-swap.
⚠️ Not Every Pool Uses Hooks
Hooks are optional. Many Uniswap v4 pools will simply use the standard AMM with no Hook attached, giving users the same behavior as v3 but cheaper. When a Hook IS present, it's encoded in the pool address — technically, the address bits tell the PoolManager which of the eight hook points to call.
4. Key Features Hooks Enable
Dynamic Fees
v3 pools have a fixed fee tier: 0.01%, 0.05%, 0.3%, or 1%. With Hooks, a pool can implement any fee algorithm you can write in Solidity. Fees can adjust based on volatility (higher fees during volatile markets protect LPs from impermanent loss), time of day, trading volume, current price momentum, or any on-chain data source. This turns LP positions from passive fee collectors into actively managed yield strategies.
Singleton Architecture & Flash Accounting
In v3, each pool is a separate deployed contract. With millions of token pairs, this means millions of contracts and a huge amount of wasted gas on cross-pool interactions. v4 deploys a single PoolManager contract that handles all pools. This alone cuts pool creation gas by 99%.
Flash Accounting pairs with this: instead of settling token transfers after every individual swap, v4 batches them across an entire transaction. You can route through five pools in one transaction, and only the net balance change across all pools gets settled at the end. This enables complex multi-hop strategies at dramatically lower gas cost.
Native ETH Support
v1–v3 required wrapping ETH to WETH before trading. v4 natively supports ETH as a pool token, removing one approval transaction and saving gas on every ETH-involved swap.
5. Real-World Hook Use Cases
By March 2026, over 2,500 custom pools have been deployed using Hooks. Here's what the builder community has created so far:
On-Chain Limit Orders
Execute limit orders directly in a pool. When price hits your target, a Hook triggers the fill automatically — no off-chain relayer needed.
Auto-Compound LP
Earned fees are automatically re-invested into the LP position after every swap, compounding returns without any user action.
MEV Revenue Sharing
Hooks can intercept MEV profits on a pool (from arbitrageurs) and redistribute a share back to LPs, turning MEV from pure extraction into a yield source.
TWAMM (Time-Weighted AMM)
Execute large orders over time to minimize price impact — same as a TWAP order on a CEX, but entirely on-chain via Hook logic.
KYC-Gated Pools
Institutional pools can require identity verification before allowing LP deposits or swaps, enabling compliant DeFi without sacrificing on-chain settlement.
Prediction Markets
Pool logic extended to support outcome-based settlement. UniMarket is a live example of a prediction market built directly on top of a v4 Hook.
6. Uniswap v4 vs v3: What Changed
| Feature | Uniswap v3 | Uniswap v4 |
|---|---|---|
| Customization | None — fixed AMM logic | Hooks: unlimited custom logic per pool |
| Architecture | Separate contract per pool | Singleton — one contract, all pools |
| Settlement | Per-swap token transfers | Flash Accounting — net batch settlement |
| Fee Tiers | 4 fixed options (0.01–1%) | Unlimited — any fee algorithm via Hooks |
| Native ETH | No (must wrap to WETH) | Yes — native ETH supported |
| Pool Creation Gas | ~$50–$200 | ~$0.10–$1 (99%+ reduction) |
| LP Composability | Basic ERC-721 positions | Custom position logic via Hooks |
| Launch | May 2021 | January 31, 2025 |
It's worth noting that v3 pools are not being deprecated. Uniswap v3 will continue to run alongside v4 indefinitely. Most casual users will migrate naturally as v4 liquidity deepens on key pairs.
7. Security Risks You Need to Know
Hooks dramatically expand the attack surface of any pool. Before interacting with a v4 pool that uses a Hook, you need to understand these risks:
Malicious Hooks
A Hook contract could be deliberately written to steal funds. When you swap on a v4 pool with a Hook, that Hook code runs with access to your swap context. Always verify the Hook contract has been audited and the source code is verified.
Improper Delta Handling
Hooks return 'deltas' that affect token balances. A misconfigured delta return can cause fund misallocation, unexpected fees, or unfair pricing — even without malicious intent.
Async Hook Custodianship
Some Hooks temporarily take custody of assets during execution. During this window, poorly written logic could be exploited, causing user funds to be locked or misdirected.
Centralization Risks
If a Hook has an admin key or governance mechanism, a malicious upgrade could change behavior after you've provided liquidity. Always check if a Hook is upgradeable and who controls it.
No Hook Does Not Mean Safe
Even pools without Hooks can have other risks (smart contract bugs, oracle manipulation). Hooks add to the risk surface — they don't replace standard DeFi due diligence.
⚠️ This guide is for informational purposes only. It is not financial advice. DeFi protocols including Uniswap v4 carry smart contract risk, economic risk, and the specific risks of any Hook deployed on a given pool. Always do your own research and only risk funds you can afford to lose.
8. How to Use Uniswap v4 Today
For most DeFi users, interacting with Uniswap v4 works exactly like using v3 through the Uniswap interface at app.uniswap.org. The router automatically finds the best price across all v4 pools, including Hook-enabled ones.
If you want to specifically use a Hook-powered feature (like a limit-order pool), you'll typically access it through a specialized front-end built on top of the Hook contract rather than the main Uniswap UI. The ecosystem is still maturing — expect specialized Hook UIs to proliferate throughout 2026 as the Uniswap Foundation's Hook Incubator program graduates more projects.
For LPs: Providing liquidity on v4 is similar to v3, but with a new consideration — which Hook does this pool use, if any? For core pairs like ETH/USDC or WBTC/USDC, you'll find large pools with no Hook (safe defaults). More exotic Hook-enabled pools offer potentially higher yield with correspondingly higher smart contract risk.
🏗️ Building a Hook? Start Here
- Use
BaseHookfrom Uniswap's official repo — it enforces the interface correctly. - Get a security audit before deploying to mainnet — no exceptions.
- Apply to the Uniswap Foundation Hook Incubator for mentorship and funding.
- Test on the v4 testnet deployments (Sepolia, Base Sepolia) before mainnet.
Frequently Asked Questions
What are Uniswap v4 Hooks?
Hooks are external smart contracts that attach to individual Uniswap v4 liquidity pools and execute custom logic at specific lifecycle points — before/after swaps, before/after liquidity changes, and at pool initialization. They let developers add features like dynamic fees, limit orders, or MEV revenue sharing to any pool.
When did Uniswap v4 launch?
Uniswap v4 launched on January 31, 2025. It reached $1B in TVL within 177 days and processed over $180B in cumulative volume by September 2025. As of March 2026, overall Uniswap TVL across all versions sits around $6.8B.
What's the difference between Uniswap v3 and v4?
v4's biggest changes are: Hooks (custom pool logic), the Singleton architecture (one contract instead of one per pool), Flash Accounting (batch token settlement), and native ETH support. Together these cut gas costs dramatically and unlock a new layer of DeFi programmability that wasn't possible in v3.
Are Uniswap v4 Hooks safe to use?
Hooks expand the attack surface of any pool. A malicious or buggy Hook can drain funds or manipulate pricing. Always verify that any Hook contract you interact with has been audited, that the source code is verified on-chain, and that you understand who controls any admin functions. Pools with no Hook attached have the same security profile as standard v3 pools.
What can you build with Uniswap v4 Hooks?
Already-live examples include on-chain limit orders, dynamic fee pools (fees that adjust based on volatility), auto-compounding LP positions, MEV revenue sharing, KYC-gated institutional pools, TWAMM (time-weighted average market making), and prediction markets. Over 2,500 custom pools have been deployed using Hooks since launch.
Does Uniswap v4 still use the UNI token?
Yes. UNI is the governance token for the Uniswap Protocol. UNI holders vote on protocol upgrades, fee switches, treasury allocations, and chain deployments. Uniswap v4 did not change this governance structure.