I broke a testnet pool before I understood what a hook was. I deployed a toy contract, attached it to a pair on a Sepolia fork, and watched a swap revert. That’s often how people actually get to meet Uniswap V4 hooks.
Uniswap V4 was launched on Ethereum mainnet and nine other chains on January 31, 2025. And it rebuilt the base layer of how automated market makers work.
In this post, I’ll walk you through what hooks are, how the new Pool Manager works, what permissioned pools mean for institutions, and what “dynamic AMM” means in practice.
Key Takeaways
- Hooks are external smart contracts that plug into a pool and run custom code at defined moments in a swap, deposit, or withdrawal.
- A single Pool Manager contract now holds every pool’s state, which is why creating a new pool costs up to 99.99% less gas than in V3.
- Permissioned pools let issuers gate liquidity behind compliance checks. That’s how regulated players like Securitize and Superstate are using V4.
- Dynamic fees replace V3’s fixed tiers, letting a pool’s LP fee move with volatility or volume in real time.
- Hooks are also the biggest new attack surface in Uniswap’s history. Two hook-based protocols have already lost a combined $20 million to exploits in 2025.
What Is Uniswap V4?
Uniswap V4 is the latest version of the Uniswap protocol. It’s a singleton AMM where every pool lives inside one contract instead of its own deployment, and where developers can attach custom logic to any pool through hooks.

The latest version comes with three structural changes:
- One contract, not thousands: V3 deployed a new contract for every trading pair. V4 uses one Pool Manager for all of them.
- Hooks as first-class citizens: Anyone can write a hook contract and slide it onto a pool during creation.
- Flash accounting: Instead of settling tokens after every step, V4 tracks running balances and only moves tokens once, at the end.
V4 is built for two audiences. The developers who want to ship custom pool logic without forking the protocol, and the traders who benefit from cheaper, more flexible pools underneath. It functions as a platform where other people build products on top of, the way Shopify is a platform for stores. As of now, V4 pools hold roughly $1.1 billion in TVL and have processed nearly $38 billion in trading volume over the past 30 days.
How Uniswap V4 Hooks Work
A hook is an external smart contract attached to one specific pool. It’s not a middleware sitting between you and Uniswap. It just lives inside the pool’s own execution path and gets called at exact moments during a swap, a liquidity deposit, or a withdrawal.
Think of it like a plugin system.
A pool without a hook behaves exactly like a standard concentrated-liquidity pool. But a pool with a hook can do almost anything at those checkpoints. Like charge a different fee, block a swap, reward a specific LP, or pull data from an oracle before letting a trade go through.

Two properties are supposed to keep this contained:
- A hook is permanently locked to the pool it was created with and can’t be swapped out later.
- A hook can only use the callback functions it explicitly declared permission for at deployment, so it can’t silently gain new powers.
Those two properties limit what a hook is allowed to touch.
The hook lifecycle and callback points
Uniswap V4 gives developers eight callback points, in four pairs, each firing before and after a core action:
- beforeInitialize / afterInitialize, fired once when a pool is created.
- beforeAddLiquidity / afterAddLiquidity, fired around LP deposits.
- beforeSwap / afterSwap, fired around every trade.
- beforeDonate / afterDonate, fired when tokens are donated directly to a pool.
A hook doesn’t need to implement all eight. It just declares which one it uses through bit flags baked into its own contract address. That address-level encoding is clever, but it’s also what the attackers probe first, since a mismatch between declared permissions and actual logic is a known failure class.
The Pool Manager and Singleton Architecture
Every pool in Uniswap V4 works under one contract; the Pool Manager. Liquidity positions, price ticks, and fee data for every single pool sit in that one contract’s storage instead of being scattered across thousands of individually deployed pair contracts, which is what V3 required.
Singleton here just means there’s exactly one instance of this contract, shared by every pool. The practical effect is gas. Deploying a new contract on Ethereum is expensive. But updating a state variable inside an existing contract isn’t. That’s why creating a new pool in V4 is described as up to 99.99% cheaper than in V3.
Flash accounting explained
Flash accounting is a settlement model that works beneath singleton. The Pool Manager tracks net balance changes, called deltas, using Ethereum’s transient storage.
All those deltas settle once, at the very end of the transaction. If anything is still owed when the transaction closes, it reverts entirely.
For a multi-hop swap, this cuts out redundant transfers between steps that used to happen only to get reversed a moment later by the next hop. Fewer transfers means less gas.
Permissioned Pools in Uniswap V4
A permissioned pool is a regular V4 pool with a hook that gates access before a swap or liquidity action is allowed to go through. The hook checks a whitelist, a KYC status, or some other compliance rule at the beforeSwap or beforeAddLiquidity checkpoint, and it can simply refuse the transaction if the check fails.
This exists for one clear reason. The tokenized RWAs and securities can’t legally trade on a fully open, permissionless pool. So, the issuers need a way to enforce who can hold and trade a token without abandoning an AMM’s pricing and liquidity model.
Here are some early adopters:
- Superstate: Tokenizing short-term government bonds.
- Securitize: A tokenization platform that works with regulated securities.
- Dowgo: Building compliance infrastructure on top of hooks.
But here’s a tradeoff. The permissioning is opt-in per pool, not a protocol-wide switch. Uniswap V4 itself stays permissionless by default. But a permissioned pool run by a centralized issuer means that the issuer decides who gets to trade.
Dynamic AMMs and Dynamic Fees
A dynamic AMM is a pool whose behavior, most commonly its fee, changes in response to live conditions instead of staying fixed at launch. In V3, you picked a fee tier (0.05%, 0.30%, 1%) and it stayed there forever. But in V4, a hook attached to the pool can update the fee on every swap based on whatever logic the developer wrote.
Here are a couple of examples:
- Volatility-responsive fees: A hook can raise the LP fee during high volatility, when impermanent loss risk to LPs spikes. And lower it during calm periods to stay competitive on price.
- Auto-compounding hooks: Instead of an LP manually claiming and reinvesting fees, a hook can route earned fees straight back into the position automatically.
This is also where TWAMM (time-weighted average market maker) and on-chain limit orders come in. Both were previously separate protocols attached awkwardly to Uniswap. But as hooks came in, they became native pool behavior instead of external infrastructure with its own trust assumptions.
Static fee tiers were a blunt instrument. Dynamic fees are a real attempt to match the fee to the actual risk LPs are taking on, in real time, rather than guessing it once and leaving it alone.
Uniswap V4 vs Uniswap V3: What Changed
Here’s the comparison that actually matters if you’re deciding whether to build or route liquidity on V4:
| Dimension | Uniswap V3 | Uniswap V4 |
| Contract architecture | New contract per pool | Singleton Pool Manager, one contract for all pools |
| Customization | None, fixed protocol logic | Hooks, arbitrary custom logic per pool |
| Fees | Fixed tiers (0.05% / 0.30% / 1%) | Dynamic, hook-controlled per swap |
| Gas to create a pool | Full contract deployment | Up to 99.99% cheaper (see above) |
| Native ETH | Requires WETH wrapping | Native ETH supported directly |
| Token settlement | Transfer after each step | Flash accounting, net settlement at the end |
The net effect: V3 was a very good, very rigid AMM. V4 is a framework for building AMMs, with Uniswap’s own default pool as just one configuration of it.
Uniswap V4 Hook Security Risks
This is a very crucial section. Hooks are the single biggest new attack surface Uniswap has introduced, and the money already lost to them proves the risk is real.
Two real incidents in 2025 are worth knowing in detail:
- Cork Protocol, $12 million: Attackers exploited insufficient access control on a hook’s callback function, effectively calling beforeSwap with manipulated data it shouldn’t have accepted.
- Bunni v2, $8.4 million: A reentrancy guard bypass in the hook’s custom accounting logic let an attacker drain pool reserves by exploiting unsafe external calls to an arbitrary vault address.
Both exploits were done by some third-party hook code layered on top of Uniswap’s core Pool Manager. It’s exactly the risk profile an open plugin architecture creates; the base layer gets audited to death, and every plugin on top of it still needs its own scrutiny, individually, every time.

Here are a few checks that are non-negotiable:
- Confirm whether the hook contract has been independently audited or not.
- Check whether the hook is immutable or sits behind an upgradeable proxy someone controls.
- Look at whether pool creation and hook addresses are restricted, since V4 doesn’t block malicious hook deployment by default.
- Verify the hook’s declared permission flags actually match what its code does.
Uniswap’s core protocol has a strong track record on this front. Before launch, it went through nine independent audits, a $2.35 million security competition with over 500 participants, and the largest bug bounty in DeFi history at $15.5 million for critical bugs, and nothing critical turned up. V2 and V3 combined processed over $2.75 trillion in volume with zero protocol-level hacks. That record belongs to Uniswap’s own contracts.
Real-World Use Cases for Uniswap V4 Hooks
A few patterns are already running in production:
- Dynamic fee pools that adjust LP fees based on realized volatility.
- On-chain limit orders, executed as a hook rather than an off-chain orderbook bolted onto the AMM.
- TWAMM hooks for splitting large orders over time to reduce the price impact.
- Permissioned compliance pools for tokenized bonds and securities.
- Auto-compounding LP hooks that reinvest fees without manual claims.
- Oracle hooks that feed external price data into pool logic before a swap executes.
This is new territory for V4. V3 couldn’t do any of this without forking the whole protocol.
Final Thought
Uniswap V4 turns a product into a platform. The core AMM logic still works the way it always has, but the interesting part now happens in the hooks other people build on top of it. And that shifts where the risk and the value both sit. The Pool Manager can be audited once and trusted broadly. Every hook has to earn that trust on its own.
If you are building on V4, read the official hooks documentation before you touch mainnet, and treat every hook you did not write yourself as unverified until proven otherwise.
For more info on crypto and all things Web3, visit Blockverse.
FAQs
External smart contracts attached to a single pool that run custom logic at defined points in a swap, deposit, or withdrawal, letting developers customize pool behavior without forking the protocol.
Yes. It launched on Ethereum and nine other chains on January 31, 2025.
The core protocol is heavily audited, but individual hooks are not automatically safe. Two hook-based protocols lost a combined $20 million to exploits in 2025, so each hook needs its own audit.
V4 avoids having to create a contract per pair, allows for custom logic hooks, token dynamic fees, and flash accounting settlement.
The single smart contract that holds the state for every pool on the protocol, replacing V3’s model of deploying a separate contract for each trading pair.
It depends on the hook’s logic, but pool creation itself is far cheaper, up to 99.99% less gas than V3, and flash accounting reduces gas on complex multi-pool routes.