DeFi Intel

Uniswap v4 Hooks Explained: Singleton, Custom AMMs, and the UNIfication Thesis

Uniswap v4 is the most consequential AMM redesign since concentrated liquidity. By combining a singleton architecture with a hook system, v4 turns Uniswap from a fixed protocol into a programmable liquidity platform — one where developers can ship custom AMM logic without forking the core. This guide walks through the architecture, the hook ecosystem as it stands in 2026, the v3-to-v4 migration question, how v4 fits next to intent-based DEXs like CowSwap, and the UNIfication tokenomics narrative now driving UNI.

The architectural break: singleton + hooks

Singleton: one contract, all pools

In Uniswap v3 every pool was its own contract, deployed by a factory. Creating a new pool cost roughly 5M gas and produced an isolated address. v4 reverses that: a single PoolManager contract holds all pool state. New pools cost ~99 percent less to create because there's no deployment, just a state entry. Multi-hop routes become dramatically cheaper because token transfers between hops are virtual — the singleton tracks net deltas and only settles balances at the end of a transaction. This is enabled by flash accounting, where intermediate states can be transiently negative and only the net obligation must be cleared by transaction end.

Second-order effect: the singleton makes flash-loans free in spirit. Any caller can borrow within a transaction so long as they restore balances before settle, removing the rationale for a separate flash-loan contract.

Hooks: lifecycle plugins

A hook is a contract address attached to a pool at creation time. The PoolManager invokes it at fixed lifecycle points: beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeDonate, afterDonate. The hook can also override return values — beforeSwap can return a custom delta, effectively replacing the constant-product math with anything the developer wants.

Hook permissions are encoded in the bottom 14 bits of the hook contract's address — a clever device that lets the PoolManager check at deployment what callbacks a hook needs without storing extra state. A hook that wants beforeSwap and afterSwap callbacks must be deployed at an address whose bits match those flags. Tooling like CREATE2-mining libraries handle this address vanity-mining.

Flash accounting and the lock pattern

v4 enforces a lock pattern: the singleton can only be operated on inside an unlock callback. A swapper unlocks the manager, executes any number of operations (swaps, liquidity changes, transfers), and at the end of the callback all balances must net to zero. This is what makes routing across N pools cost roughly the same as one pool — there are no intermediate ERC-20 transfers, just internal accounting.

What hooks unlock

Custom AMM curves

The most powerful capability: replace the Uniswap math entirely. A beforeSwap hook can compute a custom price from a constant-sum, constant-power, or fully off-curve formula and return the resulting delta. Stableswap-style curves, weighted pools, oracle-priced pools, and concentrated liquidity over arbitrary distributions are all expressible as hooks. This collapses the historical reason to build a separate AMM (Curve, Balancer) — you can now ship those mechanics as a v4 hook and inherit Uniswap's routing, frontends, and liquidity gravity.

Dynamic fees

v3's fee tiers (1bp, 5bp, 30bp, 100bp) are static. A hook can set the fee per swap based on volatility, pool inventory imbalance, time-of-day, or the identity of the swapper. Bunni v2's hook adjusts fees in proportion to realized variance — fees rise during volatile windows (compensating LPs for adverse selection) and fall in quiet markets (attracting flow). Empirical results from Bunni's mainnet pools in 2025 showed material LP outperformance versus equivalent v3 positions in volatile assets.

MEV protection and RFQ filling

A beforeSwap hook can route the order to an off-chain solver auction before touching public liquidity, mimicking RFQ desks. Sorella Labs' Angstrom hook auctions order flow to professional market makers, returning rebates to swappers and pushing toxic flow off the public AMM. The result: cleaner LP returns and tighter retail execution, all without leaving the v4 surface. This is the hook ecosystem's most direct answer to CowSwap-style intents.

Just-in-time liquidity

JIT — placing concentrated liquidity right before a known large swap and removing it immediately after — was a controversial v3 strategy because professional searchers crowded out passive LPs. A v4 hook can either restrict JIT (e.g., a minimum dwell time) or institutionalize it, e.g., a managed-liquidity hook that automatically tightens ranges around incoming swaps and shares profits with depositors.

On-chain limit orders and TWAMM

A hook can register conditional liquidity — capital that becomes active only when the pool's price crosses a threshold — implementing native limit orders. TWAMM (Time-Weighted Average Market Maker) hooks execute slow-running orders block by block, designed for whales who want to acquire or unwind a position over hours without market impact. Cron Finance pioneered on-chain TWAMM but announced it was winding down in 2023, before v4 launched; in v4 the design is expressible directly as a hook.

Standout hooks in 2026

The v4 hook ecosystem is still maturing — total v4 TVL crossed $1B in early 2026, well behind v3's $4-5B but climbing fast. The hooks pulling the most attention:

Most of the long tail is experimental — KYC pools, social-graph-gated pools, cross-domain LP hooks. The 80/20 reality: a small number of professional hooks will capture the majority of TVL, the same way a handful of v3 pools dominate fee generation today.

v3-to-v4 migration

Uniswap v4 launched on Ethereum mainnet in early 2025 and rolled out across Optimism, Arbitrum, Base, Polygon, BSC, Avalanche, and Unichain through 2025. Migration is voluntary; v3 continues to operate. As of Q1 2026, v4 holds roughly 20-25 percent of cumulative Uniswap TVL with the rest still on v3, but v4's share of swap volume is rising faster than its share of TVL — a sign that hook-bearing pools are out-trading static v3 fee tiers per dollar of liquidity.

LPs migrating from v3 to v4 face a question: which hook? A vanilla v4 pool (no hook attached) is mostly equivalent to v3 with slightly better gas. The decision is whether to deposit into a hook-managed pool that promises better fee dynamics or routing, accepting the additional smart-contract risk of the hook contract. The Uniswap front end (app.uniswap.org) curates the hook list users see; the on-chain reality is permissionless.

For swappers, v4 is mostly invisible — the auto-router picks the best venue across v2, v3, and v4 pools, and gas costs on multi-hop routes are noticeably lower.

v4 vs CowSwap intents

A recurring debate: do hooks make intent-based DEXs redundant, or vice versa?

Intents (CowSwap, UniswapX, 1inch Fusion) are an off-chain auction layer. A user signs an order describing what they want; solvers compete to fill it against any combination of liquidity venues. Intents win on flexibility (any source of liquidity), MEV protection (auctions are private), and gasless UX (the solver pays gas). They lose on settlement latency (multi-block), composability (off-chain orders are harder to chain into other on-chain logic), and on the long tail (small orders below solver attention).

v4 hooks are on-chain infrastructure. Hooks like Sorella's bring intent-style MEV protection on-chain, narrowing the gap. But intents systems also route into v4 — a CowSwap solver picks v4 pools when they offer best price. The two layers compose: intent front end + hook-protected pool = both worlds.

The likely steady state: intents capture institutional and large retail flow; v4 hooks capture programmable on-chain liquidity; small swaps route through whichever is cheaper at the moment. Both expand the addressable market for Uniswap's underlying liquidity.

UNIfication: tokenomics and the fee switch

UNI has historically been a pure governance token — no cash flow accrual to holders. The 'fee switch' has been governance-debated since 2022: turn on a protocol fee that diverts a slice of LP earnings to a treasury or stakers. Multiple snapshot votes have signaled support but the final on-chain activation has been delayed by tax and regulatory considerations.

The UNIfication thesis bundles three catalysts:

  1. Fee switch activation — directing a percentage of LP fees (typical proposals: 10-25 percent) to UNI stakers, transitioning UNI from governance token to cash-flow token.
  2. Unichain — Uniswap Labs' own L2 (launched 2024-2025) that captures sequencer revenue. Unichain block production is paid for in ETH; profits accrue to a Unichain treasury that, in current proposals, would flow to UNI stakers as a separate revenue stream.
  3. v4 hook revenue — pools with hooks can implement protocol-level fee splits. As hook adoption grows, UNI gains a programmable lever to capture surplus.

If all three activate, UNI's economic profile shifts materially. As of early 2026 fee-switch governance is the closest to passage, with multiple Uniswap Labs and Foundation signals indicating activation is a question of when, not if. The catalyst windows: tax-clarification milestones in the U.S. (post-GENIUS Act), Unichain TVL crossing material thresholds, and v4 fee revenue overtaking a baseline.

Tokenomics snapshot

Risks

Hook risk. A malicious or buggy hook can drain LPs or grief swaps. The PoolManager itself is locked down — bugs there would be systemic — but hooks are user-deployed code with full callback authority. Best practice for LPs: only deposit into pools whose hooks have been audited, are open-source, and have material TVL elsewhere; treat hook code as you would treat a vault strategy.

Singleton concentration. All v4 liquidity flows through one contract. v4-core was audited by Trail of Bits, OpenZeppelin, Spearbit, ABDK, and Certora (formal verification of core invariants), with a $15.5M Cantina bounty before launch — among the most heavily reviewed contracts in DeFi history. But concentration of risk remains: a critical core bug would simultaneously affect every v4 pool.

Liquidity fragmentation. v3 and v4 will coexist for years. LPs choosing between versions face a real tradeoff between v3's battle-tested simplicity and v4's hook-driven optimization.

Governance dependency. UNI's value thesis depends on fee-switch activation, which in turn depends on resolving tax treatment and on-chain governance flows. Delay risk is real.

Hook centralization at the front end. Users predominantly access v4 through app.uniswap.org, which curates a hook allow-list. This reintroduces a soft permissioning layer despite on-chain permissionlessness.

Bottom line

Uniswap v4 is less a DEX upgrade and more an AMM operating system. The singleton makes deployment cheap and routing efficient; hooks make pools programmable. The 2026 question is not whether v4 wins on architecture — it does — but how fast the hook ecosystem matures into a durable category of programmable liquidity primitives. UNI's value path runs through three intertwined catalysts: fee switch, Unichain, and v4 fee growth. The protocol that started as a Vyper experiment in 2018 is now the closest thing crypto has to a default liquidity layer.

Sources and further reading

About the author

DeFi Intel Research is the in-house research team at DeFi Intel, focused on on-chain capital markets, MEV, ZK infrastructure, and verifiable AI.

Last updated: 2026-04-30

Entities mentioned

Frequently asked questions

What is Uniswap v4 in plain English?
Uniswap v4 is a re-architecture of the Uniswap AMM that collapses every pool into a single contract (the singleton) and lets developers attach plug-in code called hooks at fixed lifecycle points (before/after initialize, swap, and liquidity changes). The result: cheaper deployments, gas-efficient multi-pool routing, and programmable pools that can implement custom curves, dynamic fees, on-chain limit orders, MEV protections, and more — without forking the core protocol.
How is v4 different from v3?
v3 deployed a separate contract per pool, with concentrated liquidity but fixed fee tiers and no extension points. v4 keeps concentrated liquidity but adds: (1) the singleton — one contract holds all pool state, slashing deployment cost ~99 percent and enabling efficient flash-accounting; (2) hooks — optional contracts that fire callbacks at lifecycle events; (3) native ETH support without WETH wrapping; (4) flash accounting, where balances can go temporarily negative within a transaction and only the net delta settles. v4 requires new periphery — because the PoolManager can only be operated inside an unlock callback, existing v2/v3 routers cannot trade against v4 pools; swaps route through v4-aware periphery such as the Universal Router.
What can hooks actually do that v3 could not?
Hooks unlock things v3 either could not express or required a fork to implement. Examples already deployed or audited: custom AMM curves like StableSwap-on-v4 or constant-power means; dynamic fees that adjust to volatility (Bunni); on-chain limit orders implemented as conditional liquidity; just-in-time (JIT) liquidity placement for known incoming swaps; MEV protections like RFQ filling (Sorella) where swaps route through a private auction before touching public liquidity; on-chain TWAMM-style time-weighted execution; LVR-aware fees that auction the right to trade against stale prices; and KYC-gated pools for institutional venues.
What are the standout hooks to know in 2026?
Bunni v2 — dynamic-fee + rehypothecation hook that auto-adjusts fees with realized volatility and routes idle inventory to lending markets for additional yield. Sorella Angstrom — sandwich-resistant hook that auctions order flow to professional fillers and rebates retail. Doppler — token launch hook with a Dutch-auction bonding curve. Arrakis HOT — institutional managed-liquidity hook. TWAMM hooks — long-running time-weighted orders. The early hook ecosystem is still small (low double digits of production hooks at scale) but growing fast as v4 audits clear and incentives flow.
How does v4 compare to CowSwap and intents-based DEXs?
They occupy different layers. Intents systems (CowSwap, UniswapX, 1inch Fusion) are off-chain auction layers where solvers compete to fill user orders against any liquidity venue, including v3, v4, RFQ desks, and CEX inventory. v4 is on-chain liquidity infrastructure that intents systems route into. The two are complementary: an intent-based front end can settle on v4 pools that themselves have MEV-protection hooks, getting the best of both. Where they overlap is dynamic-fee/private-flow capture — Sorella-style hooks bring some of CowSwap's MEV-rebate logic on-chain, narrowing the gap for power users.
What is the UNIfication thesis and the fee switch?
UNIfication is shorthand for the long-debated activation of UNI's protocol fee switch — directing a slice of LP fees to UNI stakers — paired with the Unichain L2 launch and v4-driven fee growth. The thesis: v4 hooks expand Uniswap's surface area dramatically (more pools, more programmable revenue) while Unichain captures sequencer revenue native to the protocol. If fee-switch governance activates, UNI transitions from pure governance token to cash-flow token, with stakers earning a share of protocol fees across v3, v4, and Unichain. As of early 2026 the fee switch has been proposed multiple times and remains in active governance discussion; activation timing is the central UNI catalyst.
What are the risks of v4 and hook-based pools?
Three live risk surfaces. (1) Hook risk — a malicious or buggy hook attached to a pool can rugpull LPs or grief swaps; pool factories and front ends curate which hooks they expose, but on-chain anyone can deploy a pool with any hook. (2) Centralization of liquidity — the singleton means a critical bug in core would compromise all pools simultaneously; v4 underwent extensive audits (Trail of Bits, OpenZeppelin, Spearbit, Certora formal verification) plus a $15M+ bounty before launch. (3) Fragmentation — v3 still holds material TVL and fees; v4 migration is voluntary, so liquidity remains split across versions for the medium term. LPs need to evaluate hook code before depositing, the same way they evaluate vault strategies.

Stay current on this topic

Get the weekly DeFi Intel brief — entity-graph intelligence delivered weekly, free to your inbox.