top of page
uniswap exchange.jpg

Uniswap is a decentralized exchange (DEX) built on the Ethereum blockchain that allows users to swap cryptocurrencies directly from their personal wallets without an intermediary. Unlike traditional exchanges like Coinbase or the New York Stock Exchange, Uniswap doesn't use an order book; instead, it uses a system called an Automated Market Maker (AMM). 

This guide breaks down Uniswap’s architecture and provides a step-by-step tutorial for your project. 

Phase 1: Core Concepts and Architecture

To understand how Uniswap works, you must first grasp the three pillars of its decentralized design.

1. The Constant Product Formula ()

Uniswap uses a mathematical formula to determine token prices and maintain market balance: 

  • : The total amount of one token (e.g., ETH) in a liquidity pool.

  • : The total amount of the second token (e.g., DAI).

  • : A constant value that must remain unchanged after a trade.
    When you buy ETH from the pool, you add DAI to it. To keep  the same, the price of ETH increases as the supply of ETH in the pool decreases. 

2. Liquidity Pools and Providers (LPs)

Instead of matching a buyer with a specific seller, Uniswap has "pools" of money. Anyone can become a Liquidity Provider (LP) by depositing an equal value of two tokens into a pool. 

  • Incentive: In exchange for providing their funds, LPs earn a portion of the trading fees (typically 0.3%) paid by users who swap tokens in that pool. 

3. Concentrated Liquidity (Uniswap V3)

In earlier versions, your money was spread thin across every price from zero to infinity. Uniswap V3 introduced concentrated liquidity, allowing LPs to choose a specific price range (e.g., $2,000–$2,500 for ETH). 

  • Efficiency: This lets LPs earn higher fees with less capital because their funds are only used when the price is within their chosen range. 

Phase 2: How to Use Uniswap (Step-by-Step)

For your project, you can document these steps to demonstrate the user experience.

Step 1: Set Up a Self-Custody Wallet 

Uniswap is "non-custodial," meaning you hold your own keys. You need a wallet like MetaMask or the Uniswap Wallet

  • Fund it: Ensure you have some ETH in your wallet to pay for "gas fees" (network costs). 

Step 2: Connect to the App

Navigate to the Uniswap Web App and click "Connect Wallet". Select your wallet and approve the connection in the pop-up window. 

Step 3: Select Tokens to Swap 

In the Swap interface:

  1. Choose the token you want to give (e.g., ETH).

  2. Choose the token you want to receive (e.g., UNI or USDC).

  3. Enter the amount. The app will automatically calculate the current exchange rate using the Auto Router to find the best price. 

Step 4: Adjust Settings (Slippage) 

Click the settings (gear) icon to adjust your Slippage Tolerance. This is the maximum price change you're willing to accept before the transaction fails. Standard setting is 0.5%. 

Step 5: Review and Swap

Click "Review Swap" to see the final details, including network costs and price impact. If satisfied, click "Swap" and confirm the transaction in your wallet. The tokens will appear in your wallet once the blockchain processes the transaction. 

Phase 3: Governance and the UNI Token

Uniswap is governed by its community, not a single company. 

  • Governance Token: $UNI holders can vote on proposals like protocol fee changes or how to spend the community treasury.

  • Decentralization: This structure ensures that no central authority can censor trades or freeze your funds. 

bottom of page