Uniswap v2

Uniswap v2: A Complete Guide to Trading, Liquidity, and DeFi Fundamentals

Uniswap v2 is the pioneering automated market maker (AMM) that brought frictionless ERC-20 to ERC-20 swaps to the mainstream of decentralized finance. Built on Ethereum, it uses a simple yet powerful constant product formula (x * y = k) to enable permissionless trading, real-time price discovery, and yield opportunities through liquidity provision. Whether you’re swapping tokens or earning fees as a liquidity provider, Uniswap v2 remains a foundational, battle-tested protocol in the DeFi stack.

Key takeaway: Uniswap v2 blends simplicity, transparency, and decentralization — making it a reliable on-ramp to DeFi for both traders and builders.


What Is Uniswap v2?

Uniswap v2 is a decentralized exchange protocol where users trade directly from their wallets without intermediaries. Each market is a liquidity pool containing two ERC-20 tokens, and prices adjust automatically based on the pool’s reserves. The design removes order books and custodians, replacing them with immutable smart contracts, clear incentives, and open, transparent liquidity accessible to anyone.

“Code as markets: Uniswap v2 turned liquidity into a programmable building block for a more open financial system.”


How Uniswap v2 Works

At its core, Uniswap v2 uses a constant product market maker model. When you swap Token A for Token B, the pool balances adjust so that the product of the reserves remains constant. This is what drives price impact and why large trades move the price more. Liquidity providers deposit equal values of both tokens and receive LP tokens that represent their share of the pool (and claim on fees).

  • ERC-20 to ERC-20 pairs: Any two tokens can form a market, not just ETH pairs.
  • LP tokens: Fungible ERC-20 receipts representing your share; redeem to withdraw assets + fees.
  • TWAP oracles: Built-in time-weighted average price data for safer on-chain integrations.
  • Flash swaps: Borrow tokens within a single transaction — repay or return by the end of the block.
  • Permissionless and non-custodial: No KYC; you keep control of your keys.


Fees, Costs, and Price Impact

Uniswap v2 charges a 0.30% fee per swap, which goes fully to liquidity providers by default. Depending on governance settings, a small protocol fee (typically 0.05% of trades) may be enabled, diverting a portion of the 0.30% to the protocol treasury. Your effective trade outcome also depends on slippage (price movement during execution) and gas fees paid to the network. Manage these via slippage tolerance and transaction deadlines in your wallet or interface.

  • Swap fee: 0.30% (default to LPs)
  • Protocol fee: Optional, if governance-enabled
  • Gas costs: Vary by network congestion; consider L2s for lower fees
  • Price impact: Higher on thin liquidity or large orders


How to Use Uniswap v2 (Step-by-Step)

Getting started with Uniswap v2 is straightforward. You’ll need a Web3 wallet (e.g., MetaMask), some ETH for gas, and the tokens you plan to trade or deposit.

  1. Connect your wallet: Open a trusted Uniswap-compatible UI and connect your wallet securely.
  2. Select tokens: Choose the token you’re selling and the token you want to buy. Verify token contracts to avoid phishing.
  3. Enter amount: The UI calculates your expected output, including fees and price impact.
  4. Adjust settings: Set slippage tolerance (e.g., 0.5%–1%) and a reasonable deadline.
  5. Approve token spend: For the first trade or LP action, approve the token for the router contract.
  6. Swap or add liquidity: Confirm in your wallet and wait for on-chain confirmation.
  7. Manage LP tokens: If providing liquidity, you’ll receive LP tokens; retain them to claim fees or withdraw later.


Uniswap v2 vs. Uniswap v3 vs. Uniswap v1

Wondering when to choose Uniswap v2? This comparison highlights the core differences to help you decide based on liquidity needs, fee structures, and capital efficiency.

Feature Uniswap v1 Uniswap v2 Uniswap v3
Pool Type ETH-token only ERC-20/ERC-20 pairs Concentrated liquidity ranges
Swap Fee 0.30% 0.30% (protocol fee optional) Multiple fee tiers (e.g., 0.05%, 0.3%, 1%)
LP Tokens ERC-20 LP tokens ERC-20 LP tokens Non-fungible NFT positions
Oracles Basic price exposure TWAP built-in TWAP with improvements
Capital Efficiency Low Moderate High (custom ranges)
Flash Swaps No Yes Yes
Complexity Very simple Simple, robust Advanced; requires management
Gas Profile Low Low–moderate Moderate (more logic)


Core Benefits of Uniswap v2

For many users and protocols, Uniswap v2 hits the sweet spot of simplicity, reliability, and decentralization. Here are standout advantages that keep it relevant across networks and use cases.

  • Battle-tested security: Extensively audited contracts powering a massive share of DeFi volume.
  • Predictable economics: A single 0.30% fee makes modeling straightforward.
  • Composable building block: TWAP oracles and flash swaps enable rich DeFi integrations.
  • Fungible LP positions: Easy to track, transfer, and integrate with other protocols.
  • Open access: Anyone can create pools and add liquidity without permission.


Risks and How to Manage Them

DeFi is powerful but not risk-free. Understanding and managing risk helps you make smarter, safer decisions on Uniswap v2.

  • ⚠️ Impermanent loss: When relative prices move, LPs may underperform holding. Use correlated pairs or monitor volatility.
  • ⚠️ Smart contract risk: Audited doesn’t mean risk-free; use trusted interfaces and stay updated.
  • ⚠️ Slippage & MEV: Large trades can face price impact and sandwich attacks. Set slippage tolerances and consider splitting orders.
  • ⚠️ Token risk: Permissionless listings mean scams can appear. Always verify contract addresses.
  • ⚠️ Network fees: High gas can erode returns. Consider L2 networks when available.


For Developers: Architecture and Integrations

Uniswap v2 is composed of three primary contracts: Factory (creates pools), Pair (AMM core holding reserves), and Router (periphery for user flows like multi-hop swaps and liquidity management). Each pair exposes cumulative prices enabling TWAP oracles; routers handle WETH wrapping, path routing, and safe transfers.

  • 🔧 Pair contract: Reserves, mint/burn for LP tokens, swap, sync; emits events for indexing.
  • 🔧 TWAP oracle: price0CumulativeLast, price1CumulativeLast with blockTimestampLast for on-chain TWAPs.
  • 🔧 Flash swaps: Borrow assets within a transaction; return or provide equivalent value by end.
  • 🔧 Router v2: Multi-hop paths, deadlines, slippage controls, and safe ERC-20 approvals.


LP Strategies on Uniswap v2

Liquidity provision suits different risk profiles. Consider pairing stable-to-stable tokens for lower IL, or high-volume volatile pairs for potentially higher fee income. Rebalancing frequency, external hedging, and monitoring on-chain metrics (reserves, volume, fee APR) are key levers. Remember to account for gas costs and tax implications based on your jurisdiction.

  • 📊 Stable/pegged pairs: Lower IL, more predictable yield.
  • 📈 Blue-chip pairs: Solid volume with moderate volatility.
  • 🎯 Volatile pairs: Higher fees but higher IL risk — monitor closely.
  • 🧰 Hedging: Offsetting exposure using derivatives or dynamic rebalancing strategies.


Best Practices for a Smooth Uniswap v2 Experience

Streamline your swaps and liquidity decisions with these practical, experience-backed tips. They help reduce errors, protect against scams, and optimize your outcomes.

  • 🔒 Verify tokens: Use official contract addresses from reputable sources to avoid imposters.
  • ⏱️ Set sensible deadlines: Prevents stale transactions from executing in changed market conditions.
  • 🧮 Right-size orders: Split large trades to reduce price impact and MEV exposure.
  • 🧩 Track fees & PnL: Use analytics dashboards to understand fee APR and IL effects.
  • 🌐 Optimize gas: Consider off-peak times or L2 deployments when available.


Frequently Asked Questions about Uniswap v2

What makes Uniswap v2 different from v1?

Uniswap v2 introduced ERC-20 to ERC-20 pairs, built-in TWAP oracles, and flash swaps, removing the ETH-only constraint of v1. It also improved safety and composability, making it a better base layer for DeFi applications.

How do liquidity providers earn on Uniswap v2?

LPs earn a portion of the 0.30% fee from every trade that routes through their pool, proportional to their share of the liquidity. Fees accrue in the pool and are realized when LP tokens are burned to withdraw assets.

What is impermanent loss and can I avoid it?

Impermanent loss occurs when the relative prices of pooled tokens change. It can reduce LP returns versus holding assets. It’s minimized with correlated pairs (e.g., stablecoins) and balanced by fee income; it cannot be completely eliminated in volatile markets.

Are Uniswap v2 trades anonymous?

Uniswap v2 is non-custodial and permissionless, but transactions are public on-chain. While no account or KYC is required, your wallet activity is visible to blockchain explorers unless additional privacy techniques are used.

What are flash swaps on Uniswap v2?

Flash swaps let you borrow tokens from a pool within a single transaction and repay by the end of that transaction. They enable advanced strategies like arbitrage and refinancing without upfront capital, but they require careful, atomic execution.

How do I reduce slippage and MEV risk?

Use tight but realistic slippage settings, split large orders into smaller chunks, avoid peak congestion, and consider private transaction relays if supported. Monitoring liquidity depth and recent price action also helps.

Is Uniswap v2 still relevant after v3?

Yes. Many users prefer Uniswap v2 for its simplicity, fungible LP tokens, and predictable fee model. It remains widely integrated across DeFi and continues to support significant trading and liquidity activity.



Ready to trade or earn with Uniswap v2? Connect your wallet, verify token addresses, set your slippage, and make your first swap or provide liquidity today. DeFi starts with a single transaction — take control now.