Uniswap v4

Uniswap v4 is the most significant architectural redesign in Uniswap’s history. While v2 introduced constant product AMMs, v3 introduced concentrated liquidity, v4 introduces hooks — a plugin system that allows arbitrary code to execute at key moments during pool operations (before/after swaps, before/after liquidity changes). This transforms Uniswap from a fixed AMM into programmable liquidity infrastructure. Combined with a singleton contract architecture (all pools in one contract) that reduces gas costs dramatically for deployments and swaps, v4 unlocks use cases impossible in previous versions. V4 launched on Ethereum mainnet in early 2025 after a testing period.


The Hook System

The following sections cover this in detail.

What Hooks Are

A hook is a smart contract that implements specific callback functions. When a v4 pool is created, it can optionally specify a hook contract address. Uniswap v4 then calls the hook at these moments:

Available hook callbacks:

  • beforeInitialize / afterInitialize — before/after pool creation
  • beforeSwap / afterSwap — before/after each swap
  • beforeAddLiquidity / afterAddLiquidity — before/after LP deposits
  • beforeRemoveLiquidity / afterRemoveLiquidity — before/after LP withdrawals

What hooks can do:

  • Modify swap amounts (e.g., charge custom fees)
  • Call external contracts (e.g., update an oracle, trigger a rebalance)
  • Reject operations under specific conditions (e.g., pause swaps during oracle manipulation)
  • Return data to the caller

Hook Examples

Dynamic fees:

A hook watches swap volume → increases fees during high-volatility periods (reduces LP impermanent loss) → decreases fees during low volatility (attracts more volume). Creates adaptive fee tiers instead of fixed 0.05%/0.3%/1%.

Limit orders:

A beforeSwap hook checks if the price has reached a user’s limit order target → executes the order atomically if yes → no off-chain matching engine needed.

TWAP oracle:

A afterSwap hook updates a TWAP (time-weighted average price) oracle on every trade; projects can use this for on-chain price feeds with custom freshness/manipulation resistance parameters.

MEV protection:

A beforeSwap hook implements a commit-reveal scheme or private mempool integration → sandwich attacks become impossible for that pool’s users.

Automated liquidity rebalancing:

A hook that calls Chainlink oracles or Uniswap v3 prices to auto-rebalance LP ranges → comparable to what protocols like Arrakis/Gamma do today but native to the protocol.


Singleton Architecture

v3 problem: Each pool is a separate contract. Deploying ETH/USDC requires deploying a new smart contract; swapping through multiple pools requires multiple external calls (expensive gas).

v4 solution: One contract holds ALL pools:

  • Pool state stored in a hashmap: poolId → PoolState
  • Deploying a new pool: ~99% cheaper gas (no new contract, just storage write)
  • Multi-hop swaps: All within same contract, cheaper calldata

Flash accounting:

v4 uses a “debt settlement” model — tokens are not moved between each step of a multi-hop swap; only the net balance change at the end of the entire transaction is settled. This further reduces gas for complex swaps.


Native ETH Support

v4 restores native ETH support removed in v2/v3:

  • v2/v3 required WETH (wrapped ETH) as one side of ETH pairs
  • v4: ETH/USDC pool uses unwrapped ETH as the gas token directly
  • Saves users the WETH wrap/unwrap gas cost (small but meaningful for frequent swappers)

Business Source License

v4 launched under a modified Business Source License (BSL 1.1):

  • Restricts forks from deploying v4 in a “production or live environment” for 4 years
  • After 4 years: code converts to GPL open source
  • Uniswap Labs’ rationale: prevent competitors from immediately forking and competing without contributing development
  • Uniswap Foundation can grant exceptions to the license
  • Same approach was used for v3; common criticism: limits composability and community forks

UNI Token and Governance

Uniswap v4 is governed by UNI token holders through Uniswap DAO:

  • Hook whitelisting policies (if any centralized curation)
  • Protocol fee switch (turning on fees that flow to UNI holders)
  • Deployment to new chains
  • Grant programs via Uniswap Foundation

The ongoing debate: When does the fee switch activate? The fee switch would direct a portion of swap fees to UNI holders rather than fully to LPs. UNI governance has voted against activating the fee switch multiple times — when (and if) it activates is the core UNI value catalyst debate.


Ecosystem: Hook Marketplace

V4’s hook ecosystem is expected to mirror app stores or DeFi protocols:

  • Developer builds a novel hook → deploys it
  • Pool deployers choose hooks when creating pools
  • Liquidity migrates to pools with superior hooks (better LP returns, lower fees for traders)
  • Hook developers may monetize through embedded fees in hook logic

Projects already building v4 hooks during testnet (2024):

  • Angstrom: MEV protection hooks (Sorella Labs)
  • Arrakis PALM: concentrated liquidity management hook
  • Revert Finance: automated LP range management
  • Multiple TWAP oracle and limit order hook implementations

How to Use Uniswap v4

For traders: Same interface as v3 — visit app.uniswap.org, swap as normal; v4 routes automatically when beneficial.

For LPs: More options: choose standard pools (no hook) or hook-enabled pools with specific strategies.

For developers: Deploy a hook contract implementing the IHooks interface; specify hook address when creating a pool via the PoolManager. Use Uniswap’s Foundry-based testing framework for hook development.

Acquire ETH for gas and trading on . Secure assets with — Ledger supports Uniswap v4 via MetaMask.


Social Media Sentiment

Uniswap v4 generated significant developer excitement for its hook architecture — it’s the most talked-about Ethereum DeFi protocol update in years. The flexibility to build custom AMM behaviors without forking Uniswap could consolidate liquidity that currently fragments across specialized DEXes. Criticisms include: hook complexity adds smart contract risk surface (users should evaluate which hooks are in pools they interact with), the 4-year BSL restricts the open-source composability that made DeFi great, and the singleton architecture creates a systemic contract risk (one bug in the singleton pool manager could affect all v4 pools). The UNI fee switch debate continues — without a clear catalyst, UNI’s value remains speculative on future governance decisions.


Last updated: 2026-04

Related Terms


Sources

Adams, H., Zinsmeister, N., Salem, M., Keefer, R., & Robinson, D. (2021). Uniswap v3 Core. Uniswap Labs.

Angeris, G., & Chitra, T. (2020). Improved Price Oracles: Constant Function Market Makers. MARBLE.

Xu, J., Vavryk, N., Paruch, K., & Cousaert, S. (2023). SoK: Automated Market Maker (AMM) Based Decentralized Exchanges (DEXs). IEEE Access.

Park, A. (2021). The Conceptual Flaws of Constant Product Automated Market Making. SSRN.

Fritsch, R., Schneider, D., & Wattenhofer, R. (2021). Concentrated Liquidity in Automated Market Makers. ACM.