Uniswap: x*y=k, concentrated liquidity, LP economics and the V2→V4 evolution

Radar Expert explains Uniswap from V2 to V4: the constant-product curve, price impact and arbitrage, impermanent loss, V3 ranges, fee concentration, out-of-range risk, then the V4 singleton PoolManager, flash accounting and hooks.

Uniswap: x*y=k, concentrated liquidity, LP economics and the V2→V4 evolution
Uniswap replaces a traditional order book with programmable liquidity. In V2, price emerges from two token reserves and the x*y=k invariant. Arbitrage brings the pool price back toward external markets while LPs earn fees, but the pool also mechanically sells the appreciating asset and buys the depreciating one—creating divergence loss, commonly called impermanent loss. V3 concentrates capital: an LP chooses a price range and receives greater fee exposure per dollar while the market stays inside it. V4 preserves concentrated-liquidity mathematics but changes the architecture: pools live in a singleton PoolManager, settlement uses flash accounting, and hooks can run custom logic before or after key pool actions.

V2 replaces an order book with the x*y=k curve

A Uniswap V2 pool holds reserves of two tokens. If those reserves are x and y, the product should not decrease after an ordinary swap under fee-adjusted accounting. In the idealized no-fee form:

**x · y = k**

Here k is the invariant. A trader does not need a matching limit order; the trade changes the composition of the pool itself.

Price comes from the reserve ratio

With 100 ETH and 200,000 USDC in reserves, the marginal price is around 2,000 USDC per ETH. When a trader buys ETH using USDC, the ETH reserve falls, the USDC reserve rises, and the next unit of ETH becomes more expensive.

Price impact is nonlinear

A small trade relative to pool depth moves reserves only slightly. A large trade travels farther along the constant-product curve and receives a worse average execution price.

The V2 fee increases value belonging to LPs

Classic V2 swaps retain 0.30% of input inside the pool. Fees therefore accumulate in reserves and belong to LPs in proportion to their share of the pool.

A Uniswap AMM pool where two token reserves form an onchain market without a central order book
Official Uniswap Developers diagram showing the anatomy of a liquidity pool in which swaps change reserve ratios and therefore price.

A V2 LP token represents a proportional share across the full range

V2 liquidity is distributed from prices near zero to effectively infinity. LPs deposit both assets at the current ratio and receive fungible ERC-20 pool tokens representing proportional reserve ownership.

V2 simplicity comes with low capital efficiency

Most capital may rarely participate in trading when the real market price remains inside a narrow band, yet the position still funds the entire mathematical curve.

Swap flow: arbitrage synchronizes an AMM with the outside market

Uniswap does not have a proprietary oracle forcing its pool price to equal Binance, Coinbase or another venue. Price convergence happens through trading.

The external price can move first

Suppose ETH moves from 2,000 to 2,200 USDC elsewhere while a Uniswap pool still implies 2,000. ETH is temporarily cheaper inside the AMM.

An arbitrageur buys the underpriced ETH

The trader sends USDC to the pool, removes ETH and moves the reserve ratio until further arbitrage is no longer profitable after gas, fees and execution costs.

LPs pay the economic cost of rebalancing

The pool systematically sells the asset that is appreciating relative to the other and accumulates the asset that is falling. This automatic inventory shift creates divergence from passive holding.

A Uniswap swap against pool reserves changing the reserve ratio and AMM price
Official Uniswap visual showing trade flow between a user and pool reserves.

Arbitrage improves price alignment but is not free to LPs

It restores a market-consistent pool price so subsequent users can trade sensibly. Part of the arbitrageur's profit, however, comes from stale pool inventory and must be offset by fee income for LP economics to outperform holding.

LP economics: fees should be compared with a HODL benchmark

The most common LP mistake is looking only at earned fees. The proper benchmark asks what the exact same starting assets would be worth if they had simply remained outside the pool.

Example: one token doubles in price

Assume an LP starts with a $10,000 V2 position split 50/50 by value: $5,000 in token A and $5,000 in stablecoin. If token A doubles, the passive portfolio would be worth $15,000.

After constant-product rebalancing, the LP position is worth about **$14,142** before fees. Relative to holding, that is approximately **−5.72%**.

V2 divergence-loss formula

If the relative price changes by a factor r, the LP result versus holding before fees is:

**IL(r) = 2√r / (1+r) − 1**

At r=2 the result is roughly −5.72%; at r=4 it is about −20%.

“Impermanent” does not mean guaranteed to reverse

If the LP withdraws after the price move, the divergence becomes realized. It disappears only if the relative price returns to the starting point before exit, ignoring fees and other costs.

LP return = fee income + incentives − divergence loss − gas/rebalancing costs − adverse selection and other execution effects. A displayed APR without this decomposition says little about real PnL.

Fees can exceed divergence loss

A pool with high volume relative to TVL may generate enough fees to outperform the HODL benchmark. That is an empirical outcome, not a mathematical guarantee of the AMM.

V3 turns LPs into price-range market makers through concentrated liquidity

Uniswap V3 changed the capital-allocation model. Each LP selects lower and upper price bounds inside which its liquidity is active.

Capital works only inside the selected range

While spot price sits between the bounds, the position participates in swaps and earns fees. A narrower range can provide more virtual liquidity per dollar of deposited capital.

Price space is discretized into ticks

V3 represents prices through ticks on a geometric grid. The pool tracks liquidity changes when swaps cross initialized ticks.

Positions are no longer fungible pool shares

Two LPs in the same token pair can choose different ranges and receive different fee exposure. V3 positions are therefore typically represented through NFTs by the NonfungiblePositionManager rather than one fungible LP token.

Uniswap concentrated liquidity where an LP chooses a price band instead of funding the entire curve
Official Uniswap range-order diagram illustrating liquidity that is active only across a selected price interval.

Narrow ranges improve capital efficiency and increase management risk

A narrow position can earn more fees per dollar while trading remains inside its band. It also goes out of range more often, stops earning swap fees and becomes one-sided.

Concentrated liquidity turns passive LPing into a strategy

Range selection, fee tier, rebalancing frequency and gas budget become part of an explicit market-making policy rather than a passive 50/50 deposit.

What happens when a V3 or V4 position moves out of range

Out-of-range mechanics are central to concentrated liquidity.

Above one boundary the position becomes a single asset

As price moves through the upper or lower bound, liquidity is progressively converted into one side of the pair according to pool orientation.

Fee earning stops outside the active range

The position still exists, but it is no longer active in current swaps until price re-enters the range or the LP changes the position.

Rebalancing has real costs

An LP can close a range and open another, but pays gas, may realize an unfavorable inventory composition and can repeatedly chase a trending market.

A range order resembles a limit order but is not identical

A narrow, one-sided position can convert inventory as price crosses the band. Execution follows an AMM curve, and price can reverse before the LP withdraws.

A liquidity provider depositing a token pair into Uniswap and taking exposure to pool economics
Official Uniswap Developers illustration accompanying the discussion of ranges, fees and LP inventory composition.

V3 LP PnL depends on range, volume and the path of price

For V2, divergence loss can be summarized with a simple endpoint formula. V3 is more path dependent because fee generation and active liquidity depend on time spent inside the range.

The same terminal price can produce different fee outcomes

A price that oscillates inside the range for days can generate substantial fees. A price that crosses the range once and stays outside may generate little fee income despite ending at a similar level.

Active liquidity competes locally for fees

Swap fees are distributed among liquidity active around the current price. Capital far away from spot does not compete for those fees until the market reaches its ticks.

Narrow ranges amplify adverse-selection exposure

High liquidity density attracts flow near spot, but informed trades and sharp price moves can repeatedly trade against stale inventory before LPs rebalance.

Stable pairs and volatile pairs require different range logic

For correlated assets, a tight range may be rational while the peg assumption holds. For volatile pairs, the same width produces more frequent exits.

FactorWide rangeNarrow range
Capital efficiencyLowerHigher
Probability of staying in rangeHigherLower
Fee densityLowerPotentially higher
Rebalancing needLowerHigher
Out-of-range riskLowerHigher

V2 → V3: what changed inside the pool architecture

V3 did not discard constant-product intuition; it localized the curve into price segments.

V2 has one fungible liquidity state per pair

The reserve ratio and total LP supply are enough to describe pro-rata ownership of the full-range curve.

V3 stores ticks and net liquidity changes

When price crosses a tick, the pool activates or deactivates liquidity associated with positions. Current state includes sqrtPrice, current tick and active liquidity.

Fee tiers become part of market selection

V3 supports multiple pools for one token pair with different fee tiers and tick spacing. LPs and traders can select structures suited to volatility and order flow.

Oracle observations are stored in pool state

V3 maintains time-series observations that can support TWAP-like integrations. Consumers still need to reason about manipulation windows and their own oracle design.

V4 changes infrastructure through a singleton PoolManager

Uniswap V4 preserves concentrated-liquidity fundamentals while changing how pools are deployed and settled.

PoolManager is a singleton for many pools

A single contract manages the state and accounting of many pools. Pool identity is defined by currencies, fee, tick spacing and hook configuration.

Native ETH is supported directly

V4 brings back native ETH support, reducing the need to wrap ETH into WETH for every pool-level interaction.

Multi-hop routes move fewer ERC-20 tokens between contracts

In V3 each hop crosses separate pool-contract boundaries. A V4 singleton can account for intermediate deltas inside one shared accounting session.

Uniswap V4 flash accounting where intermediate token deltas are tracked inside one PoolManager session
Official Uniswap V4 diagram showing how singleton accounting can reduce intermediate token transfers.

Architectural savings are most visible in complex routes

The more hops and pool interactions involved, the more useful net settlement can become. Actual gas still depends on hook logic, token behavior and the exact route.

A singleton changes the blast-radius model

This does not imply administrative centralization: core contracts remain permissionless and non-upgradeable by design. It does mean that a bug in a shared manager has a different technical blast radius from bugs in fully separate pool contracts.

Flash accounting tracks deltas first and settles at unlock completion

V4 uses a transient accounting model. A caller opens an unlock session, executes a sequence of pool actions and the PoolManager tracks net currency deltas.

Intermediate operations do not all require immediate token transfers

If a route swaps A→B and then B→C in one session, intermediate B can exist as an accounting delta rather than a complete ERC-20 transfer between isolated pool contracts.

All deltas must be settled by the end

The caller must return the manager's balance state to an acceptable settled condition before unlock completes. Unresolved obligations revert the whole transaction.

Atomicity becomes a composability tool

A complex route can combine swaps, liquidity modifications, takes and settlements in one transaction. Either the whole set succeeds or chain state reverts.

Flash accounting is not a free flash loan

The name refers to the accounting lifecycle. Temporary positive or negative deltas inside an atomic call do not remove the requirement to settle value before completion.

V4 hooks make the pool lifecycle programmable

A hook is an external contract whose address encodes which callbacks it supports. A pool can call a hook before or after initialize, add/remove liquidity, swap and donate actions.

beforeSwap and afterSwap can change market behavior

A hook can update dynamic fees, maintain custom accounting, add routing constraints or auxiliary logic, or implement specialized market structures.

A hook is not a governance plugin added later to an arbitrary pool

The hook address is part of the pool key. Users interact with a specific pool created with a specific hook configuration.

Hook code adds its own trust surface

Uniswap core can be heavily reviewed while a custom hook still contains bugs, owner controls, external dependencies or unusual fee logic. Security analysis should treat core plus hook as one system.

Dynamic fees become a first-class design space

V4 can use dynamic-fee pools, and hook logic can update fees under an explicit strategy. This may adapt pricing to volatility or order flow while introducing new model risk.

V4 makes Uniswap less like one fixed AMM and more like a framework for AMM-style markets. The more a hook modifies standard behavior, the less a user can rely on familiar x*y=k intuition alone.

UNI governance and protocol economics are separate from LP returns

UNI is a governance token for the Uniswap ecosystem; LP returns come from providing liquidity to specific pools.

Holding UNI does not automatically grant every swap fee

Governance can control protocol-fee mechanisms and other governance-controlled settings within the protocol's defined boundaries, but token ownership is not automatically a pro-rata claim on all LP fees.

Core contracts and governance have different boundaries

Uniswap documentation emphasizes permissionless, non-upgradeable core deployments. Governance cannot retroactively reverse an executed swap or arbitrarily rewrite immutable core logic.

Protocol fees and LP fees are different flows

Swap fees may be allocated according to version-specific rules and enabled protocol settings. Analysis has to inspect the exact version, pool and configuration.

UNI valuation cannot be derived from TVL alone

TVL measures LP capital rather than token-holder cash flow. Token economics depend on governance rights, protocol-fee decisions, ecosystem use and actual value-accrual mechanisms.

How to verify an Uniswap position or swap onchain

The interface is convenient, but production analysis should begin from chain, version and exact contracts.

For a swap, inspect the route and actual pools

One UI swap may cross several pools, versions or routing systems. Price impact should be understood from the executed route rather than the ticker pair alone.

For V3 and V4 LPs, inspect bounds and current tick

A position is in range or out of range according to current pool price relative to lower and upper ticks. That immediately explains whether it is earning swap fees now.

For V4, inspect the hook address

A hook implies custom behavior. Review source verification, permissions, callbacks and external dependencies.

Fee APR is incomplete without a PnL benchmark

Compare current assets plus earned fees minus costs with the HODL value of the same starting assets. Annualized interface APR does not replace that test.

A liquidity screenshot is a snapshot, not a strategy

TVL, volume and active ranges move quickly. Evaluating an LP strategy requires historical fees, price path, realized volatility, gas and rebalance costs, and time spent in range.

The main conclusion

Uniswap's evolution is a sequence of increasing **capital efficiency and programmability**.

V2 introduced a simple constant-product AMM: capital funds the full curve, LP shares are fungible, reserve ratios move price, and arbitrage synchronizes the pool with external markets. V3 retained AMM mathematics but gave LPs ranges and ticks, making capital more efficient and turning liquidity provision into an actively managed market-making strategy. V4 keeps concentrated liquidity while moving pools into a singleton PoolManager with flash accounting and hooks, making routing and extension far more programmable.

For LPs, the useful question is not “what APR does the interface show?” but **what is the benchmark versus holding, how long is the position in range, what fee density does it capture, what does rebalancing cost, and how much adverse flow trades against it?** For traders, ask **which route actually executes, how deep active liquidity is, what price impact applies, and what the hook changes.**

Uniswap is therefore better understood not as one DEX contract but as an evolving onchain market architecture: from one reserve curve to concentrated capital and then programmable pools.

FAQ

What does x*y=k mean?

It is the constant-product invariant: the product of the two reserves should not decrease during an ordinary swap under fee accounting. Changing the reserve ratio produces AMM price and price impact.

What is impermanent loss?

It is the underperformance of an LP position relative to simply holding the original assets, caused by the AMM's automatic rebalancing. In V2, when relative price doubles, the loss before fees is about 5.72% versus holding.

Why is concentrated liquidity more capital efficient?

An LP deploys capital only across a selected price range and can therefore provide more active liquidity per dollar near spot. The cost is greater out-of-range risk and more position management.

What happens when a V3 position is outside its range?

It stops being active liquidity and stops earning swap fees until price returns or the LP repositions. The position is usually mostly or entirely one of the two assets.

What is new in Uniswap V4?

V4 uses a singleton PoolManager, flash accounting, native ETH and hooks. Concentrated-liquidity math remains, while pool deployment, routing and extensibility change substantially.

Are hooks as safe as Uniswap core?

Not necessarily. A hook is separate custom code and can add bugs, permissions and dependencies. Every hooked pool should be analyzed as the core protocol plus that specific hook.

This material is educational and does not constitute financial advice or a promise of LP returns.

Trust 96 Importance 84 Noise 0% Related symbol Informational material, not financial advice.