English
  • AfrikaansAfrikaans
  • عربيعربي
  • বাংলাবাংলা
  • CatalàCatalà
  • 简体中文简体中文
  • 中文(繁體)中文(繁體)
  • DanskDansk
  • NederlandsNederlands
  • EnglishEnglishcheck-icon
  • FilipinoFilipino
  • SuomalainenSuomalainen
  • FrançaisFrançais
  • DeutschDeutsch
  • ελληνικάελληνικά
  • हिंदीहिंदी
  • MagyarMagyar
  • IndonesiaIndonesia
  • ItalianaItaliana
  • 日本語日本語
  • 한국인한국인
  • LietuviųLietuvių
  • MelayuMelayu
  • PolskiPolski
  • PortuguêsPortuguês
  • РусскийРусский
  • CрпскиCрпски
  • SlovenskýSlovenský
  • EspañolEspañol
  • KiswahiliKiswahili
  • SvenskaSvenska
  • แบบไทยแบบไทย
  • TürkçeTürkçe
  • YкраїніYкраїні
  • اردواردو
  • Tiếng ViệtTiếng Việt

Uniswap v4: A Programmable AMM for Power Users

Arya .ETH
Published On Sep 20, 2025 | Updated On Oct 29, 2025 | 9 min read
Uniswap V4 logo with futuristic digital background, highlighting the new liquidity pool customization features with hooks.
Uniswap V4 introduces customizable hooks, optimizing liquidity and enhancing capital efficiency for liquidity providers!

Uniswap v4 reframes a DEX as a programmable liquidity kernel. Where v2/v3 fixed most behaviors in-contract, v4 exposes the swap/LP lifecycle to developer-supplied hooks. Paired with a singleton PoolManager and flash accounting, v4 compresses multi-pool strategies, custom fee policies, vault integrations, and execution safeguards into single transactions, without forking Uniswap. v4 is live across major EVM L1/L2s and positioned as the lowest-cost, most customizable Uniswap to date. 

TL;DR

Uniswap v4 introduces a highly flexible and extensible AMM model with key innovations like programmable pools, flash accounting, and native ETH support. By externalizing custom logic into hook contracts and enabling dynamic fees, it allows for more tailored and efficient liquidity management.

To understand the full impact and the projects adopting these features, read on for a detailed breakdown below: 

 

  • Programmable pools via Hooks:

Uniswap v4 externalizes custom logic into hook contracts that run before/after key pool actions (init, add/remove liquidity, swap, donate). Hook permissions are encoded in the hook address, allowing the PoolManager to dispatch only the functions a hook claims to implement. This makes the AMM an extensible platform rather than a fixed design. 

  • Singleton + Flash Accounting:

All pools live under one PoolManager (singleton). Swaps/liquidity changes accrue transient debits/credits during an unlock call and only net token transfers are settled at the end, enabled by EIP-1153 Transient Storage, reducing gas and enabling cross-pool compositions in a single call. 

  • Native ETH, dynamic fees, hook fees:

v4 restores native ETH support (no WETH wrapping) and allows dynamic pool fees (via hooks) plus optional hook fees for custom value flows.

  • No built-in TWAP oracle:

Unlike v3, v4 removes the bundled oracle; projects must compose with external oracles (or v3 pools) or implement bespoke oracle hooks, which has both flexibility and risk implications.

  • Who’s building on v4:

Early notable adopters include Bunni (rehypothecating LP liquidity), EulerSwap (lending-aware AMM compatible with v4 routing), Silo V2 (hook-programmable isolated markets), Angstrom (MEV-aware app-specific sequencing), and Flaunch (fair-launch hook stack).

Technical Architecture

In this section, we look at how the architecture of Uniswap V4 works, and what PoolManager, and Balance Netting are.

Singleton PoolManager

In v3, each pool was its own contract; in v4, all pool state is managed by one PoolManager (the “singleton”). Builders interact by calling PoolManager.unlock to enter a session where they can orchestrate multiple actions, swaps, liquidity mods, donations, across pools before final settlement. This consolidates state access, slashes deployment costs, and allows deep cross-pool orchestration.

Flash Accounting via Transient Storage

Within an unlock session, changes are tracked as BalanceDelta entries in transient storage (EIP-1153). Only the net token deltas are paid at the end, eliminating intermediate transfers (and their SSTORE costs), which is especially impactful for multi-hop/multi-pool routes and integrators composing swaps with LP updates. 

Solvency invariant (informal). Let Delta_i be the signed token delta (owed to the PoolManager if >0) for token i across all actions in a session. The PoolManager enforces that after the integrator’s callback finishes, for all tokens i the outstanding Delta_i must be fully settled (via take/settle) or the transaction reverts. Gas gains arise because all intermediate legs are book-kept, not transferred, until the end. 

Hooks: Programmable Control Points

Here we see what hooks are, and how they help in fee management, and enabling native ETH instead of WETH for the pools.

What a Hook Is?

A hook is an external contract attached to a pool that can implement any subset of the before/after callbacks for initialize, modifyLiquidity, swap, and donate. The hook’s address encodes which callbacks it implements; PoolManager reads this bitmask to conditionally dispatch without extra storage. One hook can serve many pools; each pool has at most one hook. 

 

Key consequences

  • Deterministic dispatch with no per-pool storage overhead for “which hooks exist”.
  • Composable features: dynamic fees, allowlists, time locks, limit orders, oracle reads/writes, MEV filters, KYC gates, emissions gauges, vault integrations, etc.

Dynamic Fees and Hook Fees

  • Dynamic pool fees: set by the hook’s getFee logic for pools flagged with the DYNAMIC_FEE_FLAG at creation. Fees can react to volatility, inventory, oracles, or governance signals. 

  • Hook fees: fully custom charges implemented inside the hook for monetization or redistribution (e.g., fee-to-LP stakers, buybacks). They are distinct from pool fees and protocol fees.

Native ETH, Position Manager, and SDK

  • Native ETH is supported again in v4 (no wrapper), yielding simpler UX and reduced gas on ETH routes.

  • The v4 Position Manager batches multiple position operations with a command-style interface, ideal for LP strategy contracts.

  • The v4 SDK introduces a StateView helper for clean, read-only access to pool state aggregated by the singleton.

Mathematical Foundations (v3 carry-over, v4 generalization)

Uniswap’s core swap step still respects constant-product style invariants within each tick segment. In v3/v4, price is stored as √ P in Q96 fixed-point (a gas-efficient choice): 

  image-Photoroom.png 

 

Liquidity-aware price movement under an amount-in (token0 for example) at current √ P with active liquidity L and next bound √ P’ obeys (rounded to spec rules): 

  image-Photoroom (1).png 

 

which is the basis of SqrtPriceMath.getNextSqrtPriceFrom{Input,Output} and the Delta amount formulas used to compute exact swap deltas across tick ranges. 

Fees. With fee fraction f (static tiers in v3; dynamic in v4) the effective input per step is Delta x_eff = Delta x . (1- f ). Dynamic fees mean f = f(sigma, t, inventory, oracle, …) decided by the hook at execution time; the stepwise math is unchanged except the integrator must query the fee per step

 

LP position math (unchanged conceptually from v3): within bounds [a,b] and current √ P, token0/token1 reserves attributable to liquidity L follow the standard closed forms (piecewise by region), and deltas are derived from the above SqrtPriceMath relations; proofs and derivations remain those of v3. 

v4 vs v3: A Precise Comparison

Dimensionv3v4
Pool topologyOne contract per poolSingleton PoolManager manages all pools
Execution modelDirect calls to each poolunlock session; multi-pool orchestration in one call
AccountingImmediate token transfers each stepFlash accounting with transient balance netting, settle at end
CustomizationNone (beyond fee tiers, CLAMM params)Hooks for before/after callbacks; dynamic fees; hook fees
Fee policyStatic fee tiers per poolDynamic via hook + optional hook fees
ETH supportWETH onlyNative ETH paths allowed
OracleBuilt-in TWAP oracle used widelyNo built-in oracle, compose externally / via hooks
Gas profileMultiple transfers per hopFewer writes/transfers; EIP-1153 powered netting
Dev surfacePool factory + per-pool statePoolManager + hook interface + Position Manager

Security Model & Risk Surfaces

Some of the enforced security measures, despite the openness in developing, are:

  • Hook correctness & permissions. Because hooks run on critical paths, they must adhere to the IHooks contract semantics, keep reentrancy and griefing in check, and avoid centralization traps (e.g., privileged upgraders). The address-encoded permission mask limits callable hooks at runtime, but it does not guarantee safety of the logic in those hooks.

  • Oracle removal. v4 intentionally ships without a default TWAP oracle. Builders must integrate robust oracles (including v3 TWAP or third-party). Poorly designed oracles remain a major liquidation/MEV risk in DeFi, as widely analyzed.

  • MEV & sequencing. App-specific sequencing via hooks (e.g., Angstrom) can internalize order flow and auction sequencing rights to protect LPs/swapper welfare, but must be designed to preserve permissionlessness and avoid censorship.

For builders, see checklists from security firms and reference hook libraries before going live. 

Developer Playbook: How to Build and Ship on v4

Some of the important notes developers must take when diving into working with Uniswap v4 are:

  1. Pool design

Decide static params (tick spacing, initial price) and whether the pool uses dynamic fees (DYNAMIC_FEE_FLAG) and a hook.

  1. Hook design

Implement only the callbacks you need; mine/deploy an address whose bitmask encodes your implemented set. Validate pre/post-conditions on each callback (e.g., fee bounds, oracle freshness).

  1. Integrations

Use Position Manager for LP UX and StateView for read paths. Prefer a single unlock session per complex action to maximize flash accounting benefits.

  1. Testing & audits

Simulate adverse flows (sandwiching, toxic order flow, oracle gaps), verify that BalanceDelta nets to solvency, and fuzz state transitions across hooks. Guidance and example hooks abound.

Who’s Using v4, and What They Optimized

There are some protocols, besides Uniswap, that utilize the Uniswap v4 model. Not all DEXs in the market decided to take the Uniswap v4 model instead of v3, but the following protocols utilize this system.

Bunni, Re-hypothecating LP Liquidity

What it is?

A “shapeshifting” v4 DEX whose hook re-hypothecates deposited assets into yield sources, blending swap fees with external APY.

Why it matters?

Raises effective LP returns without manual vault routing, and can pair with dynamic fees to tune inventory risk.

Evidence:

Public research and the project’s repos brand Bunni as “Built on Uniswap v4”; community data often shows Bunni among the largest v4-hook volumes. 

EulerSwap, Lending-Aware AMM Compatible with v4

What it is?

An AMM that natively integrates Euler vaults; hooks allow just-in-time borrowing, custom curves, and IL-hedging behaviors while staying compatible with Uniswap routing/solvers.

Why it matters?

Collapses AMM + money-market legibility; capital serves multiple roles at once.

Evidence:

Euler’s launch materials and docs emphasize v4-hook compatibility and design goals. 

Silo V2, Hook-Programmable Isolated Markets

What it is?

A two-sided isolated lending framework exposing a hooks stack to instantiate markets with custom LTV curves, interest-rate models, and oracle choices.

Why it matters?

Encodes isolation and programmability at the market boundary; a natural fit alongside v4 pools for routing collateral/flow.

Evidence:

Silo’s public pages describe hooks-based programmable deployments and isolated-pair core concepts. 

Angstrom (Sorella Labs), App-Specific Sequencing (ASS)

What it is?

A v4 hook + off-chain auction network that controls order flow sequencing to rebate MEV and protect swappers/LPs.

Why it matters?

Moves execution welfare inside the app’s mechanism instead of leaking to block builders.

Evidence:

Uniswap Foundation features Angstrom as a v4 hook; multiple write-ups describe ASS and its goals. 

Flaunch, Fixed-Price Fair Launches via Hooks

What it is?

A launchpad on Base using a PositionManager-based v4 hook to constrain liquidity during a timed fixed-price phase, plus bespoke controls (e.g., progressive bid walls).

Why it matters?

Codifies fair-launch mechanics at the pool boundary, mitigating bot sniping and chaotic initial price discovery.

Evidence:

Flaunch docs specify their Uniswap v4 hook and additional swap mechanics; ecosystem articles cover their hook designs.     

Dozens more (Aegis DFM dynamic fees, community hook libraries, SDK tooling) illustrate an expanding v4 surface area for protocol engineers. 

Conclusion

Uniswap v4 generalizes “AMM as a product” into AMM as a platform. The combination of singleton state, flash accounting, and hook-programmability decouples core invariants from policy logic. For sophisticated teams, this unlocks specialized market microstructure, dynamic fees, execution control, vault coupling, without sacrificing Uniswap’s liquidity network or routing surface. The trade-off is complexity: correctness and security move up the stack into your hook. If you get the math and mechanism design right, v4 offers a uniquely capital- and gas-efficient canvas for DeFi innovation.

References & Further Reading

Frequently asked questions

Check out most commonly asked questions, addressed based on community needs. Can't find what you are looking for?
Contact us, our friendly support helps!

How do I migrate strategies from Uniswap v3 to v4?

Port your CLAMM math and ranges, then implement policy in a hook (e.g., dynamic fees, allowlists). Use the v4 Position Manager to batch LP ops within a single unlock session for gas efficiency.

Does removing the built-in TWAP oracle increase risk?

Yes; v4 requires external or bespoke oracle hooks. Pair with robust sources (e.g., v3 TWAP + third-party) and enforce freshness/threshold checks inside the hook to avoid manipulation.

Where do v4 gas savings come from?

From the singleton PoolManager and flash accounting (EIP-1153). Multi-pool routes and LP adjustments net balances during one unlock call, settling only the final deltas, fewer writes and transfers.