Interactive companion: UniswapV3 Interactive Explorer — configure your liquidity range and see capital efficiency, tick numbers, and IL exposure live in your browser.
In my previous post on UniswapV2, we derived the constant product formula x·y=k and showed its elegance. UniswapV3 (launched May 2021) took that formula and asked: what if liquidity providers didn’t have to provide liquidity for all prices from zero to infinity?
The answer: they don’t have to. And the result is up to 4000x more capital efficiency, the most important DeFi innovation since the original AMM.
Table of contents
Open Table of contents
- The Problem with V2 Liquidity
- Concentrated Liquidity: The Core Idea
- The Math: Virtual Reserves
- Ticks: Discretizing the Price Space
- The Tick Bitmap and Crossing
- Liquidity as an NFT
- Range Orders: The Accidental Limit Order
- Impermanent Loss in V3 vs V2
- What V3 Did to the DeFi Landscape
- V4: Hooks Are Next
The Problem with V2 Liquidity
In UniswapV2, when you deposit $10,000 into an ETH/USDC pool, your liquidity is spread across the entire price curve — from $0 to $∞ for ETH. But in practice, ETH almost never trades at $1 or $1,000,000. Your capital is “wasted” providing liquidity at prices that will never be traded.
Consider an ETH/USDC pool when ETH is at $2,000:
- 99% of all volume happens between $1,800 and $2,200 (±10%)
- Only ~5% of your deposited capital is “active” in that range
- The other 95% sits idle at price extremes, earning zero fees
UniswapV3 solves this by letting you concentrate your liquidity in a specific price range.
Concentrated Liquidity: The Core Idea
Instead of providing liquidity across [0, ∞), you choose a range [P_lower, P_upper]. Your $10,000 now provides the same depth as $200,000 would in V2 (if your range covers the current price).
As long as the price stays within your range, you earn fees proportional to your share of liquidity in that range. If the price moves outside your range, your position becomes 100% one token and earns no fees until price returns.
This creates a fundamentally different LP experience:
- Active management required: You may need to rebalance when price moves out of range
- Higher fee potential: Concentrated positions earn disproportionately more in fees
- Directional exposure: A narrow range is essentially a limit order with fee income
The Math: Virtual Reserves
V3 achieves this by transforming the constant product formula. For a position with range [P_a, P_b] and liquidity L:
virtual_x = L / √Pvirtual_y = L × √PWhere P is the current price (y/x ratio). The “virtual” reserves are what the position would have if it extended to the full [0, ∞) range — but only the portion within [P_a, P_b] is real.
The amount of real tokens in a position:
real_x = L × (1/√P_current - 1/√P_upper)real_y = L × (√P_current - √P_lower)When price equals P_lower: the position is 100% token X (all token Y has been sold as price fell — real_y formula yields zero)
When price equals P_upper: the position is 100% token Y (all token X has been sold as price rose — real_x formula yields zero)
This is why out-of-range positions are single-token — they’ve been converted during price movement.
Capital Efficiency Formula
For a V3 position in range [P_a, P_b] vs a V2 position covering [0, ∞), the capital efficiency ratio is:
Efficiency = 1 / (1 - √(P_a/P_b))For a ±10% range around current price (P_a = 0.9P, P_b = 1.1P):
Efficiency = 1 / (1 - √(0.9/1.1)) = 1 / (1 - √0.818) = 1 / (1 - 0.905) = 1 / 0.095 ≈ 10.5xFor a ±1% range:
Efficiency = 1 / (1 - √(0.99/1.01)) ≈ 100xFor a ±0.1% range (like stablecoin pools):
Efficiency ≈ 1000-4000x depending on exact parametersThis is why Curve’s stableswap pools (which concentrates near peg by default) can offer such tight spreads — and why V3 stablecoin pools have nearly displaced Curve in some pairs.
Ticks: Discretizing the Price Space
You can’t specify an arbitrary [P_a, P_b] range — that would require infinite precision. UniswapV3 discretizes the price space into ticks.
A tick i corresponds to price:
P(i) = 1.0001^iThe base 1.0001 means each tick is a 0.01% (1 basis point) price step. For ETH at $2,000:
- Current tick ≈
ln(2000) / ln(1.0001) ≈ 76,013 - Tick 76,013 = price $2,000.00
- Tick 76,014 = price $2,000.20 (0.01% higher)
- Tick 75,913 = price $1,980.04 (≈1% lower)
When you create a position in the range $1,800–$2,200, V3 finds the nearest ticks and snaps to them.
Tick Spacing and Fee Tiers
UniswapV3 pools come in four fee tiers (the 0.01% tier was added via governance post-launch), each with a corresponding minimum tick spacing:
| Fee tier | Tick spacing | Use case |
|---|---|---|
| 0.01% | 1 tick (0.01% steps) | Stablecoins (USDC/USDT) |
| 0.05% | 10 ticks (0.1% steps) | Correlated pairs (ETH/stETH) |
| 0.30% | 60 ticks (0.6% steps) | Standard pairs (ETH/USDC) |
| 1.00% | 200 ticks (2% steps) | Exotic/volatile pairs |
You can’t provide liquidity at arbitrary prices — only at multiples of the tick spacing for your fee tier. This is a deliberate engineering tradeoff: finer granularity costs more gas (more ticks to cross per swap).
The Tick Bitmap and Crossing
The pool maintains a tick bitmap — a compact representation of which ticks have active liquidity. When a swap moves the price, it needs to find the next initialized tick to know where to stop (where liquidity changes).
The bitmap stores 256 ticks per word (uint256). Finding the next active tick is a bitwise operation:
// Simplified: find next initialized tickfunction nextInitializedTick(int24 tick, bool lte) internal view returns (int24) { (int16 wordPos, uint8 bitPos) = position(tick); // Use bit manipulation to find next set bit in the bitmap // ...}“Crossing a tick” means:
- The swap price has passed through an initialized tick
- The liquidity delta at that tick is applied (positions enter or exit the range)
- Gas cost: ~10,000-15,000 gas per tick crossed
This is why complex V3 swaps (crossing many liquidity positions) cost more gas than simple V2 swaps.
Liquidity as an NFT
In V2, all LP positions are fungible — everyone’s share is represented by the same LP token. In V3, every position is unique (different range, amount, timing) so positions are represented as NFTs (ERC-721 tokens via the NonfungiblePositionManager contract).
This has major implications:
- LP positions can be traded on NFT marketplaces
- Each position has a unique token ID
- Composability: other protocols can build on top of V3 positions (Gamma, Arrakis, etc.)
Range Orders: The Accidental Limit Order
A particularly clever V3 use case: placing a position entirely above or below current price creates a range order.
Example: ETH at $2,000, you create a position in the range $2,200–$2,400 with 10 ETH:
- Your position is 100% ETH (price is below your range)
- If ETH rises through $2,200, your ETH gets swapped for USDC as the price moves through your range
- By the time price reaches $2,400, you’re 100% USDC
You’ve effectively placed a sell order for ETH at $2,200–$2,400 while earning swap fees during the crossing. This is more capital-efficient than a regular limit order (which earns nothing while waiting).
Impermanent Loss in V3 vs V2
Concentrated liquidity amplifies both gains (fees) and losses (IL). For a position in range [P_a, P_b], IL is:
IL_v3 = IL_v2 × amplification_factorWhere the amplification factor equals the capital efficiency gain. If you’re 10x more capital efficient, your IL exposure (relative to deposited capital) is also up to 10x higher.
| Scenario | V2 IL | V3 IL (±10% range) |
|---|---|---|
| Price moves 5% (stays in range) | 0.06% | 0.6% |
| Price moves 10% (hits boundary) | 0.25% | Full conversion + stops earning |
| Price moves 20% | 0.95% | N/A (out of range from 10%) |
The key insight: in V3, the worst case is your position going out of range and becoming 100% the depreciating token. If ETH drops 15% and your range was ±10%, you’re now 100% ETH with no fees. A V2 LP would still be partially in USDC at that point.
What V3 Did to the DeFi Landscape
UniswapV3 fundamentally changed who provides liquidity:
- Retail LPs: Mostly moved out. Too complex to manage, worse risk/reward than V2 for passive strategies
- Professional market makers: Moved in. They run sophisticated algorithms to maintain concentrated positions near current price
- Automated vaults: Gamma, Arrakis, Revert Finance — protocols that actively manage V3 positions for passive users
- JIT liquidity: Bots that detect pending swaps, add concentrated liquidity in the same block, earn all fees from the swap, and remove liquidity immediately after
JIT (Just-In-Time) liquidity is perhaps the most unintended consequence: bots effectively “steal” fees from passive LPs by concentrating massively around pending swaps. It’s legal, profitable, and controversial.
V4: Hooks Are Next
Announced in 2023, UniswapV4 adds a hooks system — arbitrary code executed before/after swaps, LP actions, and pool creation. This enables:
- Custom fee logic (dynamic fees based on volatility)
- Time-weighted average market makers
- Limit orders implemented as hooks
- MEV redistribution to LPs
UniswapV3’s concentrated liquidity was the innovation of 2021. V4 hooks will be the innovation of 2025-2026. The AMM design space is far from exhausted.