How Does Uniswap V2 Work?
Uniswap V2 is the original decentralized exchange that pioneered automated market making in DeFi. It uses a simple constant-product (x*y=k) formula to enable permissionless token swaps without order books. While largely superseded by V3 and V4 for active trading, V2 remains one of the most battle-tested smart contracts in DeFi with over $800M in locked liquidity and continues to serve as the backbone for many long-tail token pairs.
TVL
$962M
Sector
DEX
Risk Grade
B+
Value Grade
B
Core Mechanisms
Market Structure/AMM/Constant Product (x*y=k)
Classic constant-product AMM with uniform liquidity across the full price range (0, infinity)
The original widely-deployed AMM design. While pioneering at launch (2020), the constant-product formula is now the most battle-tested and widely forked DEX model in DeFi.
Value Capture/Fee Models/Percentage-based Fee
Fixed 0.3% swap fee on all pairs; 0.05% protocol fee now active (UNIfication, Dec 2025) directing fees to token jar redeemable by burning UNI
Fixed 0.3% swap fee on all pairs; 0.05% protocol fee activated for V2 in December 2025 via the UNIfication governance vote (passed near-unanimously Dec 25, executed Dec 28). LPs now receive 0.25%; 0.05% goes to the token jar. Anyone can burn UNI via the fire pit contract to redeem a proportional share of token jar assets. Additionally, 100M UNI (15.8% of circulating supply, ~$596M at execution price) was permanently burned on Dec 28, 2025.
Market Structure/AMM/TWAP Oracle
Cumulative price oracle updated every block, providing time-weighted average prices for external consumption
V2 TWAP oracle was a DeFi primitive used by many protocols for pricing. Vulnerable to manipulation in thin-liquidity pairs.
Governance/Voting/Token-weighted Voting
UNI token governance inherited from Uniswap governance framework, covering both V2 and V3
Shared governance with the broader Uniswap ecosystem. Low participation rates remain a concern.
Token Supply/Minting/LP Token Minting
Fungible ERC-20 LP tokens minted proportional to share of pool liquidity deposited
Fungible LP tokens are highly composable — usable as collateral in lending protocols, yield farms, and other DeFi primitives.
Market Structure/AMM/Flash Swaps
Atomic flash swaps allowing users to borrow any amount of assets and repay within the same transaction
Flash swaps enable arbitrage and liquidation without upfront capital, but also facilitate sandwich attacks and oracle manipulation.
How the Pieces Interact
Predictable price impact from the x*y=k formula combined with public mempool allows sandwich bots to extract value from every swap. Estimated 90% of Uniswap V2 blocks are vulnerable to front-running, with individual losses reaching $215K per attack.
Flash swaps can temporarily manipulate spot price within a block. While TWAP smooths manipulation over time, low-liquidity pairs can be persistently manipulated at modest cost, affecting downstream protocols relying on V2 oracles for collateral pricing.
Uniform liquidity distribution means most capital sits idle far from the current price, generating minimal fees relative to capital deployed. For volatile pairs, impermanent loss regularly exceeds fee income, causing net losses for passive LPs.
LP tokens used as collateral in lending protocols create cascading liquidation risk — a sharp price move causes IL, reducing LP token value, triggering liquidations that further depress prices in the underlying pool.
What Could Go Wrong
- Sandwich attacks exploit constant-product AMM with 90% of blocks vulnerable to front-running
- On-chain TWAP oracle is cheaply manipulable in low-liquidity pairs, affecting downstream protocols
- Impermanent loss can exceed fee revenue for volatile pairs, causing silent LP capital erosion
Oracle Manipulation Cascade via Low-Liquidity V2 Pairs
ModerateTrigger: A lending protocol relies on Uniswap V2 TWAP oracles for a long-tail asset with less than $500K liquidity, and an attacker flash-swaps to manipulate the cumulative price over multiple blocks
- 1.Attacker identifies a lending protocol using a V2 TWAP oracle for a thin-liquidity pair — Low liquidity means the TWAP can be manipulated with modest capital over a short time window
- 2.Attacker executes coordinated trades over several blocks to skew the cumulative price upward — TWAP oracle reports inflated price for the manipulated asset
- 3.Attacker deposits overvalued collateral into the lending protocol and borrows maximum against it — Lending protocol issues loans backed by artificially inflated collateral
- 4.TWAP reverts to fair value as manipulation ends; collateral becomes undercollateralized — Lending protocol suffers bad debt as attacker defaults on loans
Risk Profile at a Glance
Overall: B+ (18/100)
Lower score = safer