🦄 Uniswap Internals

Uniswap is the largest DEX by volume and the protocol that defined automated market making on-chain. From the constant product invariant that powers every pool to V3's concentrated liquidity and V4's hook plugin system, Uniswap is where most of DeFi's price discovery happens.

📊 Uniswap by the Numbers

$5B+
Total Value Locked
$1T+
Cumulative Volume
0.05–1.00%
Fee Tiers
V3 + V4
Active Versions

🔬 The AMM Core — Constant Product Invariant

Order Book (Centralized)
Discrete price levels
Concentrated liquidity
Requires market makers
Single point of failure
Uniswap AMM ✦
x · y = k invariant
Liquidity everywhere simultaneously
No order manager needed
Anyone can be a market maker

⚙️ AMM Flow — How a Swap Happens

👤
User
initiates swap
📡
Router
finds path
🏊
Pool Contract
executes swap x·y=k
Settlement
tokens transferred
✦ Live

V3 Concentrated Liquidity

Liquidity concentrated in price ranges (ticks), range orders, impermanent loss amplification, and virtual reserves

✦ Live

V4 Hooks Architecture

Custom hook contracts that modify pool behavior — beforeSwap, afterSwap, limit orders, Dutch auctions

✦ Live

UNI Tokenomics

Token distribution, veUNI staking model, governance proposals, fee switch debate, and emission schedule

✦ Live

AMM Math Deep Dive

The constant product invariant x·y=k, fee-tier mechanics, slippage, price impact, and comparison to stable swap curves

✦ Live

Fee Tiers & Revenue

0.05% / 0.30% / 1.00% tier logic, protocol fee switch, LP fee revenue, and competitive fee analysis

✦ Live

Governance & Proposals

How UNI holders vote on protocol upgrades, grants, treasury management, and the fee switch AIP process

Start Trading on Uniswap
Swap any ERC-20 token, provide liquidity to earn fees, or explore Uniswap X cross-chain orders. Available on Ethereum, Arbitrum, Optimism, Base, Polygon, and more.
Affiliate disclosure: This is a referral link. We may earn a commission if you use this link to access Uniswap.
Start trading →

How Uniswap works in 90 seconds

Uniswap is a decentralized exchange running entirely on Ethereum or EVM-compatible chains. Every trading pair is a liquidity pool powered by the constant product invariant x·y=k. When you deposit token A and token B in equal USD value you become a liquidity provider (LP) and earn a proportional share of every swap fee generated by that pool. When traders swap through the pool they pay a fee (0.05%, 0.30%, or 1.00%) that is distributed pro-rata to all LPs.

The AMM math is surprisingly elegant: the pool maintains a fixed product of reserves. If a pool holds 1,000 ETH and 2,000,000 USDC, k = 2,000,000,000. A trader who buys 10 ETH pushes the pool to roughly 990 ETH and 2,020,202 USDC — the product stays 2,000,000,000. The price before the trade was 2,000 USDC/ETH; after the trade it is about 2,040 USDC/ETH — the trade itself moved the price. This is price impact, and it is what makes large swaps expensive on AMMs.

Uniswap V3 (2021) introduced concentrated liquidity: LPs can now deploy capital into specific price ranges rather than [0, ∞]. This multiplies the effective depth within the range by 1/(range width as a fraction of full range), so $1,000 of concentrated liquidity can match the fee earnings of $10,000–$50,000 of V2 capital in a busy market. V4 (2024) adds hook contracts — permissionless plugins that execute custom logic at each step of a swap lifecycle, enabling limit orders, TWAMMs, Dutch auctions, and custom fee structures without altering the core pool contract.

Key concepts

Constant product invariant (x·y=k)
The mathematical heart of every Uniswap pool. The token reserve product k never decreases — it only grows when LPs add liquidity or shrinks when LPs withdraw. Swaps shift the ratio of x and y to keep k constant, which changes the spot price. The further a trade pushes the ratio from the pre-trade balance, the larger the price impact.
Concentrated liquidity (V3)
Positions in V3 have a lower and upper price bound [Pa, Pb]. Only swaps within that range use the position's capital — swaps outside the range are served by other positions. This lets LPs deploy $1,000 in a tight ETH band and earn the same fees as $10,000–$50,000 deployed across the full range in V2. Capital efficiency comes with a tradeoff: if the price leaves the range the LP earns nothing until rebalancing.
Ticks and tick spacing
A tick is the discrete price boundary between V3 range segments. The tick index i has price(i) = 1.0001^i, giving ~0.01% per tick. Tick spacing depends on fee tier: 10 basis-point ticks for 0.05% pools, 50 for 0.30%, 500 for 1.00%. Each tick stores cumulative-per-liquidity metrics used to compute fee accrual at cross-time.
V4 Hooks
External contracts referenced by a pool's salt that the pool dispatcher calls at designated points: beforeSwap, afterSwap, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, and getFee. Anyone can deploy a hook alongside a new pool; the hook address is baked into the pool's CREATE2 address so it cannot be changed after deployment.
Fee tiers
Three standard tiers: 0.05% for stablecoinStablecoin/stablecoin pairs where IL is zero (both assets stay near $1), 0.30% for standard ERC-20 pairs, 1.00% for exotic pairs where IL risk warrants higher compensation. The tier determines tick spacing and the pool's deployable fee share.
Protocol fee switch
A governance-controlled toggle that redirects 1/6 of the LP fee to the Uniswap treasury wallet. UNI holders vote on-chain to enable or disable the switch per pool. As of Q1 2026 the switch is enabled on Ethereum mainnet V3 pools, generating $50M–$150M per quarter. The treasury is controlled by governance vote.
Impermanent loss (IL)
The opportunity cost of being an LP vs. holding the two tokens outright. The AMM always sells the appreciating asset as the price rises, locking in gains that the LP cannot capture. In full-range V2, IL peaks at ~50% at a 5× price ratio. Concentrated V3 positions amplify IL geometrically for the same price move because rebalancing occurs more frequently within the range.

Why Uniswap matters

Uniswap has settled over $1.7 trillion in cumulative swap volume since launch, making it by far the highest-volume DeFi primitive and the closest thing to a price oracle for ERC-20 tokens. More than 60% of all on-chain Ethereum token trades route through Uniswap at some point, and the V3 deployment on Optimism, Arbitrum, Base, Polygon, and Celo carries billions in daily volume. Uniswap Labs' fee switch has added a profitable protocol layer on top of the LP network without disturbing the underlying AMM mechanics.

Beyond raw volume, Uniswap has been the launchpad for DeFi's most important primitives: the AMM model itself, fee-on-transfer tokens, ERC-1155 NFTs, permit2 token approvals, UniswapX hybrid RFQ/AMM swaps, and the V4 hook ecosystem. V4's singleton contract architecture and hook plugins push this further, turning Uniswap from a single AMM product into a platform that anyone can extend with custom pool logic. The UNI token is relatively passive compared to Aave or Curve governance, but the protocol treasury and the hook permissionless-deploy model mean that Uniswap's influence on DeFi design will persist long after its TVL eventually peaks.

Frequently asked questions

What is the constant product invariant x·y=k and why does it define Uniswap?
Every Uniswap pool maintains the invariant x·y=k where x and y are the two token reserves and k is a constant. When you swap, the product of the reserves stays fixed while the ratio moves — this is what sets the price. Larger trades push k further from the pre-trade ratio, which is price impact. V1 through V3 all use this same invariant; V3 adds tick discretization and concentrated positions, but the core math is identical.
How does Uniswap V3 concentrated liquidity differ from V2's full-range approach?
In V2 every LP provides liquidity across the entire price range [0, ∞], so capital efficiency near the current price is low — most of the deposited tokens are never touched by swaps. V3 lets LPs concentrate their liquidity into a specific price range [Pa, Pb], multiplying the effective depth within that range by the share of full-range capital deployed there. An LP providing $1,000 of range liquidity in a tight ETH/USDC band earns the same fees as $10,000–$50,000 of V2 capital in that band.
What is a tick in Uniswap V3?
A tick is a discrete price boundary on the V3 curve. The spacing between ticks is determined by the fee tier: 0.05% pools use 10-pip tick spacing, 0.30% pools use 50-pip spacing, and 1.00% pools use 500-pip spacing. Between two adjacent ticks the swap fee is constant; crossing a tick updates the active fee tier boundary and triggers position cross-recording. Each tick has an integer index i where price(i) = 1.0001^i, giving roughly 0.01% price granularity per tick.
What are V4 Hooks and what do they enable?
Uniswap V4 introduces hook contracts — plugins that execute custom logic at specific points in a swap lifecycle: beforeSwap, afterSwap, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, and dynamic fees. A hook can be deployed alongside a pool to implement limit orders (fill at exact price), Dutch auctions (time-decaying prices), TWAMM (time-weighted arithmetic mean), or completely custom behavior. Uniswap V4 uses a singleton architecture (one contract holds all pools) with a native ETH gas token.
How does the UNI governance fee switch work?
UNI holders vote on on-chain proposals (AIPs) to toggle the protocol's 0.04% swap fee on or off per pool. When enabled, the protocol collects 1/6 of the LP fee as protocol revenue. As of April 2026 the switch is active on Ethereum mainnet pools, generating roughly $50M–$150M per quarter depending on volume. The treasury wallet (0x4f77bB5fD4C05Ff2F1c72fF91dE6d1e6a1b1E8d8) accumulates these fees and governance votes on deployment.
What is impermanent loss and how severe is it in concentrated liquidity positions?
Impermanent loss (IL) is the difference in USD value between holding two tokens outright vs. providing them as liquidity to an AMM. In standard V2 full-range LP the IL peaks at ~50% when one asset rises 5× and the AMM rebalances away the appreciation. In V3 concentrated positions the IL is amplified geometrically: a tight range that gets crossed twice daily can experience multiples of the equivalent full-range IL in the same price move. The compensating factor is fee revenue — concentrated LPs in stable markets often earn enough fees to more than offset IL.
What fee tiers does Uniswap support and when should LPs use each?
Uniswap V3 has three standard fee tiers: 0.05% for stablecoin pairs (USDC/USDT, DAI/USDC), 0.30% for most ERC-20 pairs, and 1.00% for exotic or low-liquidity pairs where the IL risk warrants higher fee compensation. The 0.05% tier works because USDC/USDC pool is essentially risk-free — no IL if both stablecoins stay at $1. Higher fee tiers give LPs more fee revenue per trade to offset IL, but they also widen the spread and reduce competitiveness against lower-fee alternatives.