Skip to main content
Exchanges: CEX vs DEX

Uniswap: Swapping Tokens on Ethereum

Pomegra Learn

Uniswap: Swapping Tokens on Ethereum

How do you swap one cryptocurrency token for another without relying on a traditional exchange? Uniswap answers that question by letting you trade directly from your wallet using an automated market maker system.

Uniswap is the world's largest decentralized exchange (DEX) by trading volume, built on Ethereum. It enables peer-to-peer token swaps using mathematical formulas instead of order books, allowing anyone with a wallet to trade instantly. Unlike centralized exchanges that hold your funds, Uniswap executes trades directly on the blockchain, and you maintain control of your private keys throughout the entire process.

Quick Definition: Uniswap is a decentralized exchange protocol that uses liquidity pools and an automated market maker (AMM) model to facilitate token swaps on Ethereum and other blockchains. Users deposit cryptocurrency into pools, and traders swap tokens by exchanging them against these pools at algorithmically determined prices.

Key Takeaways

  • Uniswap operates without a central authority, meaning no middleman controls your assets or approves trades
  • Trading happens instantly through smart contracts, with prices determined by supply and demand within liquidity pools
  • Anyone can become a liquidity provider and earn trading fees by depositing cryptocurrency pairs into Uniswap pools
  • Gas fees (network costs) are the main expense, paid to Ethereum miners for processing your transaction on-chain
  • Uniswap's transparent, open-source design has inspired hundreds of DEX clones and shaped the entire DeFi ecosystem

Understanding Uniswap's Automated Market Maker Model

Uniswap doesn't use order books like traditional exchanges. Instead, it relies on liquidity pools—smart contracts that hold equal values of two crypto tokens. When you swap Token A for Token B, you're buying from the pool, and the pool's price adjusts automatically based on how much you buy.

Think of it like a self-adjusting vending machine. If you remove lots of one item, its price goes up automatically. If you add more of an item, its price goes down. This mechanism keeps the pool balanced and ensures liquidity is always available. The formula Uniswap uses is: (Token A × Token B) = constant. This mathematical relationship means deeper pools with more liquidity have lower price slippage (the difference between expected and actual price).

For example, if a liquidity pool contains 100 ETH and 300,000 USDC, the constant is 30,000,000. If you remove 10 ETH from the pool, you must add enough USDC to keep that constant. The more you remove, the worse the price becomes—this is called slippage, and it's why large trades on small pools face significant price impact.

How to Connect Your Wallet to Uniswap

Before trading on Uniswap, you need a Web3 wallet like MetaMask, Trust Wallet, or Ledger. Your wallet stores your private keys and communicates with the Uniswap interface. You never give Uniswap your private keys; instead, the wallet prompts you to approve transactions that you sign directly.

Step-by-step connection:

  1. Visit uniswap.org (always verify the URL and bookmark it)
  2. Click "Connect Wallet" in the top-right corner
  3. Select your wallet provider from the available options
  4. Your wallet will open and ask for permission to connect to Uniswap
  5. Approve the connection—you're not granting permission to move funds yet
  6. Your wallet address now appears in Uniswap's interface

This process is non-custodial, meaning Uniswap never holds your tokens. You're simply giving the interface permission to read your wallet balance and propose transactions you must sign and pay for.

Executing Your First Swap on Uniswap

Once your wallet is connected, swapping tokens takes just a few steps. The interface handles most of the complexity, but understanding what's happening behind the scenes helps you make better trading decisions.

Performing a token swap:

  1. Enter the amount of the token you want to trade (the "from" token)
  2. Select the token you want to receive (the "to" token)
  3. The interface calculates the expected output based on current pool prices
  4. Review the "Price Impact"—this shows how much the pool's price will move due to your trade size
  5. If price impact is acceptable (usually under 5% for normal trades), click "Swap"
  6. Your wallet prompts you to sign the transaction
  7. You approve and pay gas fees to Ethereum miners
  8. The transaction settles on-chain, typically within 15–30 seconds
  9. The swapped tokens appear in your connected wallet

Important details:

  • Gas fees vary based on network congestion. During busy periods, fees can exceed $50 for a single swap. During quiet periods, fees might be only $5–10
  • Slippage tolerance is the maximum price change you accept. Default is usually 0.5%, but you can increase it for less liquid trading pairs
  • Price impact affects your received amount. A 2% impact means if you expect 100 tokens, you'll get approximately 98

Choosing Between Uniswap v2 and v3

Uniswap has two active versions. Uniswap v2 is simpler and charges a flat 0.30% fee to all traders. Uniswap v3 introduced concentrated liquidity, allowing traders to choose between three fee tiers: 0.01%, 0.05%, and 1%. Each fee tier has different pools with different liquidity concentrations.

For most traders, this distinction doesn't matter—the interface automatically routes you to the best pool. But understanding the difference helps you recognize why some trading pairs have better prices than others. Pools with higher fees typically have more volatile tokens or lower liquidity. Pools with lower fees are for stablecoins and major assets like ETH and USDC.

Understanding Liquidity Pools and Your Risk

Liquidity providers (LPs) deposit equal values of two tokens into Uniswap pools to earn a portion of trading fees. If you deposit $1,000 USDC and $1,000 worth of ETH, you become an LP in that pool and earn a percentage of all trading fees generated from that pair.

However, impermanent loss is a real risk. If the price of ETH rises while you're providing liquidity, you earn fees but hold less ETH than you would have by simply holding. This divergence is called impermanent loss because it's temporary—if prices return to your entry point, the loss disappears. But if prices move significantly in one direction, you can end up worse off than if you'd simply held both assets.

For example:

  • You deposit 1 ETH ($2,000) and 2,000 USDC when ETH = $2,000
  • ETH rises to $4,000, and the pool rebalances
  • Your share now holds 0.707 ETH and 2,828 USDC (less ETH, more USDC)
  • If you had simply held, you'd have 1 ETH worth $4,000 and 2,000 USDC
  • Your liquidity position is worth slightly less than holding

Beginners should avoid providing liquidity until they understand this tradeoff. Focus on swapping first.

Real-World Example: Swapping USDC for DAI

Imagine you hold USDC stablecoin but need DAI for a DeFi lending platform. On Uniswap, you would:

  1. Connect MetaMask with 1,000 USDC
  2. Select USDC as the "from" token
  3. Select DAI as the "to" token
  4. Enter 1,000 as the amount
  5. Review the quote: perhaps 999.50 DAI due to 0.05% price impact
  6. Approve the transaction and pay $10 in gas
  7. Receive 999.50 DAI in your wallet within 30 seconds

The entire transaction happens on-chain with full transparency. Anyone can verify your swap on Etherscan, Uniswap's blockchain explorer.

Gas Fees and Network Costs

Every Uniswap transaction requires ETH gas fees. These are paid to Ethereum miners and cover the computational cost of executing your smart contract interaction. Gas fees are denominated in "gwei" (1 gwei = 0.000000001 ETH).

A typical swap costs 100,000 to 200,000 gas units. If gas price is 50 gwei per unit, your fee is approximately $50 (100,000 × 50 gwei = 5,000,000 gwei = 0.005 ETH ≈ $20–$25). During network congestion, gas prices spike dramatically. During quiet periods (early mornings, weekends), gas is cheaper.

Strategy: Batch your trades to minimize gas costs. Instead of making 10 separate swaps paying gas each time, consolidate into a few larger trades. For small amounts (under $200), gas fees might exceed your profit potential, so plan accordingly.

Checking Token Prices and Liquidity on Uniswap

Before trading, use the swap interface to preview prices. The interface shows:

  • Liquidity: Total value locked in the trading pair
  • Volume: Daily trading volume (higher volume = better prices)
  • Price impact: How your specific trade size affects the price

Deeper liquidity pools provide better prices with lower slippage. Major pairs like ETH/USDC have billions in liquidity and minimal price impact. Smaller tokens might have millions or less, leading to worse prices on large trades.

Common Mistakes to Avoid

Never send tokens directly to a Uniswap contract address. Uniswap is a smart contract, not a wallet. If you send tokens to its address directly without using the interface, your tokens are likely lost forever.

Don't ignore price impact. A 50% price impact means the pool price is moving dramatically. This usually indicates low liquidity or a very small pool. Investigate further before confirming.

Verify contract addresses. Scammers create fake token contracts with similar names (like "USD Coin" instead of "USDC"). Always check the official token list or verify through trusted sources before trading.

Understand your transaction before signing. Your wallet will show what you're approving. If something looks wrong, cancel and investigate.

Frequently Asked Questions

What makes Uniswap safer than centralized exchanges?

Uniswap is non-custodial, meaning you maintain control of your private keys throughout the entire trade. Centralized exchanges hold your funds, creating counterparty risk. However, Uniswap's smart contracts do carry smart contract risk—if a bug exists in the code, it could be exploited. The Uniswap code has been audited extensively, but no code is 100% risk-free.

Can I swap tokens on other blockchains using Uniswap?

Yes, Uniswap operates on multiple blockchains including Polygon, Arbitrum, and Optimism. However, you must switch your wallet's network setting first. Your wallet's RPC endpoint must connect to the desired blockchain before you can trade on that chain's version of Uniswap.

Why is the token I want to swap not listed on Uniswap?

Uniswap lists any token created on Ethereum, but the Uniswap interface's default list includes only major tokens. To trade smaller tokens, you can paste the token's contract address directly into the swap interface. However, be extremely cautious—scammers create fake versions of real tokens. Always verify contract addresses on official project websites.

How much do I earn as a liquidity provider?

Uniswap v2 charges 0.30% on all swaps, split among all liquidity providers. Your share depends on your percentage of the total liquidity. If you provide 1% of a pool's liquidity, you earn roughly 1% of that pool's trading fees. However, impermanent loss may offset or exceed your fee earnings.

Is Uniswap regulated?

Uniswap is a decentralized protocol without a central operator, making regulatory status unclear. The Uniswap interface is maintained by a decentralized community and the Uniswap Foundation. Individual jurisdictions treat DEX transactions differently. The U.S. Securities and Exchange Commission (SEC) has expressed concern about unregistered exchanges, though DEX regulation remains evolving.

What's the difference between Uniswap and other DEXes?

Uniswap is the largest DEX by volume and offers the deepest liquidity pools. Other DEXes like SushiSwap and Curve Finance offer different fee structures, liquidity incentives, or specialized token types. Most operate on the same AMM principle but with variations in design and governance.

Summary

Uniswap democratizes token trading by removing intermediaries and enabling anyone with an Ethereum wallet to swap cryptocurrencies instantly. Its automated market maker model maintains liquidity through mathematical formulas, making prices transparent and always available. While gas fees and slippage are costs to consider, Uniswap's non-custodial design gives you full control and eliminates counterparty risk. Understanding liquidity pools, price impact, and basic risk management transforms you from a casual user into a confident DEX trader.

The platform's simplicity and reliability have made it the gold standard for decentralized trading. As you grow more sophisticated, you'll explore advanced features like limit orders, liquidity provision, and multi-hop swaps. But the fundamentals—connecting your wallet, understanding slippage, and verifying contract addresses—remain the foundation of safe Uniswap trading.

Next: SushiSwap and Other DEX Alternatives