Uniswap: DeFi  milestone application

Uniswap: DeFi milestone application

Tags
DeFi
DEX
Published
March 15, 2025
Author
Penny Qian

Overview

Uniswap is a decentralized exchange (DEX) built on Ethereum blockchain, enabling users to trade cryptocurrencies without intermediaries (like brokers in stock markets).
Unlike centralized exchanges (e.g., Coinbase and Binance) that use traditional order books, Uniswap employs an Automated Market Maker (AMM) mechanism. This allows users to complete transactions on-chain without brokers, solving the liquidity issue of order books in decentralized settings. Through continuous iteration, Uniswap has improved user experience and capital efficiency, solidifying its leadership in the DeFi ecosystem.
So, what innovations does this Dapp bring? How does it build its on-chain trading model? And what impact does it have on users and the entire DeFi ecosystem? This article will interpret Uniswap's principles and core values from a product perspective.
 

Key value propositions

Decentralization: Uniswap operates without a central authority, minimizing risks of censorship and single points of failure. • Permissionless Access: Anyone with an Ethereum wallet can trade or provide liquidity without needing approval. • Liquidity Provision Incentives: Users can add assets to liquidity pools and earn fees as rewards. • Non-Custodial Trading: Users retain control of their funds, avoiding the counterparty risks tied to centralized exchanges (CEXs).
 

How Uniswap works?

notion image

1.Liquidity Pools Instead of Order Books

In centralized exchange systems, trades are executed by matching buy and sell orders one-to-one based on price and time priority. This traditional method depends on traders actively placing orders. When liquidity is low, the gap between bid and ask prices widens, reducing trading efficiency and making it difficult for traders to complete their transactions.
 
Instead, Uniswap uses liquidity pools, which are smart contracts holding reserves of two tokens in a trading pair (e.g., ETH/USDC、BTC/ETH).
  • Users (Liquidity Providers, LPs) deposit tokens into these pools.
  • In return, they receive LP tokens, representing their share of the pool.
  • Whenever a trade happens, Uniswap charges a small fee, which is distributed among LPs as an incentive.
    • notion image
 

2.Pricing Formula: The Constant Product Model

Uniswap uses the formula:
Where: • x = Reserved Amounts of Token X in the pool • y = Reserved Amounts of Token Y in the pool • k = A constant that remain unchanged after the trade
Example: • If there are 100 ETH and 200,000 USDC in a pool, the product remains constant: 100 * 200,000 = 20,000,000. In this example, 1 ETH=2,000 USDC and 1 USDC=0.0005 ETH. • When someone swaps 1 ETH for USDC, the amount of ETH in the pool increases to 101, the amount of USDC reduces to 198,019.80. Under this circumstances, 1 ETH=1,960.59 USDC. • This adjusts the price dynamically based on supply and demand.
 

3.Concentrated Liquidity

In Uniswap V2, liquidity is distributed uniformly along the reserves curve( x*y=K) and provided across the entire price range (from 0 to ∞). This means that much of the liquidity is not actively utilized unless the price of the tokens changes significantly.
 
Uniswap v3 allows LPs to concentrate their capital within custom price ranges. LPs “bound” their liquidity to a specific interval, meaning their capital is active (and earns fees) only when the market price is within that range. This concentration greatly improves capital efficiency and enables LPs to tailor their exposure to market conditions.
notion image
 
When users swap Δx tokens to Δy tokens, in Uniswap V2, since liquidity is distributed uniformly from 0 to ∞, the liquidity used during the swap is represented by the blue area above. If the actual price remains within a relatively stable range, most of the liquidity far from the current price is not actively utilized.As a result, only when the price experiences extreme fluctuations and moves far from the current range does this “distant” liquidity passively participate in trading.
However, Uniswap V3 allows LPs add liquidity to a specific price range [𝑝𝑎, 𝑝𝑏] given the current price 𝑝𝑐 ∈ [𝑝𝑎, 𝑝𝑏]. In this way the actual liquidity used is shown by the orange area above, which significantly improve capital efficiency. More liquidity available at active price ranges.
 
notion image
 

4.Swapping Tokens on Uniswap

When a user swaps tokens on Uniswap:
  1. They send Token A to the smart contract.
  1. The contract calculates the amount of Token B they will receive using the AMM formula.
  1. The swap is executed instantly, with a small fee going to LPs.
 
Users can set a slippage tolerance(e.g., 0.5%, 1%, 5%). If the price moves beyond this tolerance before execution, the transaction fails to protect the trader from excessive loss. Slippage in Uniswap refers to the difference between the expected price of a trade and the actual price at which it is executed. It occurs due to price impact and liquidity constraints in the pool.
notion image
 

5.Impermanent Loss & Risks for Liquidity Providers

Providing liquidity isn’t risk-free. If the price of one token in the pair changes significantly, LPs may suffer impermanent loss—a temporary loss compared to simply holding the assets.
However, trading fees can sometimes offset this loss, making liquidity provision profitable over time.
 

Version evolution from V1 to V4

Uniswap has undergone multiple upgrades from v1 to v4, each bringing significant improvements in efficiency, capital utilization, and user experience. Below is a structured comparison of the key changes:
Version
Release Year
Key Features
Limitations
Uniswap v1
2018
- Basic AMM (Automated Market Maker) model. - ETH as an intermediary for all token swaps (e.g., to swap DAI for USDC, users first converted DAI → ETH → USDC). - Fully decentralized, permissionless trading.
- High slippage for large trades. - Limited liquidity due to ETH-only pairs. - No fee distribution to liquidity providers (LPs).
Uniswap v2
2020
- ERC20 to ERC20 swaps, eliminating ETH dependency. - Price oracles using time-weighted averages. - Flash swaps, allowing users to borrow assets within a single transaction. - Fee model introduced: 0.3% fee shared with LPs
- Impermanent loss still a major risk. - Capital inefficiency (liquidity spread thinly across all price ranges)
Uniswap v3
2021
- Concentrated liquidity, allowing LPs to allocate funds to specific price ranges. - Improved capital efficiency: More liquidity available at active price ranges. - Multiple fee tiers (0.05%, 0.3%, 1%) to accommodate different risk levels. - NFT-based LP positions instead of fungible LP tokens.
- Higher complexity for liquidity providers. - Impermanent loss remains a challenge. - Gas fees on Ethereum still high.
Uniswap v4
2024
- “Hooks” system, allowing developers to customize pool behaviors (e.g., dynamic fees, on-chain limit orders). - Singleton contract, reducing gas costs by consolidating multiple pools into one. - Native support for custom AMMs beyond the classic constant product formula. - Flash accounting, reducing unnecessary token transfers and improving efficiency.
- Still in development; potential risks with custom hooks. - Governance and security challenges with increased programmability.
 

Participant Experience Analysis

1.Traders

Pain Points: High fees on CEXs, lack of access to certain tokens, KYC (Know Your Customer) friction. Solution: Direct token swaps with lower barriers to entry, albeit with gas fees on Ethereum.

2.Liquidity Providers (LPs)

Pain Points: Impermanent loss, unpredictable returns. Solution: Fee-sharing mechanism and continuous innovation (e.g., Uniswap v3’s concentrated liquidity) to improve capital efficiency.

3.Developers & Projects

Pain Points: Costly listing fees on CEXs, complex integration with existing financial systems. Solution: Open-source smart contracts allow seamless token listing and integration with DeFi protocols.
 

Reference

 

Overview

Uniswap is a decentralized exchange (DEX) built on Ethereum blockchain, enabling users to trade cryptocurrencies without intermediaries (like brokers in stock markets).
Unlike centralized exchanges (e.g., Coinbase and Binance) that use traditional order books, Uniswap employs an Automated Market Maker (AMM) mechanism. This allows users to complete transactions on-chain without brokers, solving the liquidity issue of order books in decentralized settings. Through continuous iteration, Uniswap has improved user experience and capital efficiency, solidifying its leadership in the DeFi ecosystem.
So, what innovations does this Dapp bring? How does it build its on-chain trading model? And what impact does it have on users and the entire DeFi ecosystem? This article will interpret Uniswap's principles and core values from a product perspective.
 

Key value propositions

Decentralization: Uniswap operates without a central authority, minimizing risks of censorship and single points of failure. • Permissionless Access: Anyone with an Ethereum wallet can trade or provide liquidity without needing approval. • Liquidity Provision Incentives: Users can add assets to liquidity pools and earn fees as rewards. • Non-Custodial Trading: Users retain control of their funds, avoiding the counterparty risks tied to centralized exchanges (CEXs).
 

How Uniswap works?

notion image

1.Liquidity Pools Instead of Order Books

In centralized exchange systems, trades are executed by matching buy and sell orders one-to-one based on price and time priority. This traditional method depends on traders actively placing orders. When liquidity is low, the gap between bid and ask prices widens, reducing trading efficiency and making it difficult for traders to complete their transactions.
 
Instead, Uniswap uses liquidity pools, which are smart contracts holding reserves of two tokens in a trading pair (e.g., ETH/USDC、BTC/ETH).
  • Users (Liquidity Providers, LPs) deposit tokens into these pools.
  • In return, they receive LP tokens, representing their share of the pool.
  • Whenever a trade happens, Uniswap charges a small fee, which is distributed among LPs as an incentive.
    • notion image
 

2.Pricing Formula: The Constant Product Model

Uniswap uses the formula:
Where: • x = Reserved Amounts of Token X in the pool • y = Reserved Amounts of Token Y in the pool • k = A constant that remain unchanged after the trade
Example: • If there are 100 ETH and 200,000 USDC in a pool, the product remains constant: 100 * 200,000 = 20,000,000. In this example, 1 ETH=2,000 USDC and 1 USDC=0.0005 ETH. • When someone swaps 1 ETH for USDC, the amount of ETH in the pool increases to 101, the amount of USDC reduces to 198,019.80. Under this circumstances, 1 ETH=1,960.59 USDC. • This adjusts the price dynamically based on supply and demand.
 

3.Concentrated Liquidity

In Uniswap V2, liquidity is distributed uniformly along the reserves curve( x*y=K) and provided across the entire price range (from 0 to ∞). This means that much of the liquidity is not actively utilized unless the price of the tokens changes significantly.
 
Uniswap v3 allows LPs to concentrate their capital within custom price ranges. LPs “bound” their liquidity to a specific interval, meaning their capital is active (and earns fees) only when the market price is within that range. This concentration greatly improves capital efficiency and enables LPs to tailor their exposure to market conditions.
notion image
 
When users swap Δx tokens to Δy tokens, in Uniswap V2, since liquidity is distributed uniformly from 0 to ∞, the liquidity used during the swap is represented by the blue area above. If the actual price remains within a relatively stable range, most of the liquidity far from the current price is not actively utilized.As a result, only when the price experiences extreme fluctuations and moves far from the current range does this “distant” liquidity passively participate in trading.
However, Uniswap V3 allows LPs add liquidity to a specific price range [𝑝𝑎, 𝑝𝑏] given the current price 𝑝𝑐 ∈ [𝑝𝑎, 𝑝𝑏]. In this way the actual liquidity used is shown by the orange area above, which significantly improve capital efficiency. More liquidity available at active price ranges.
 
notion image
 

4.Swapping Tokens on Uniswap

When a user swaps tokens on Uniswap:
  1. They send Token A to the smart contract.
  1. The contract calculates the amount of Token B they will receive using the AMM formula.
  1. The swap is executed instantly, with a small fee going to LPs.
 
Users can set a slippage tolerance(e.g., 0.5%, 1%, 5%). If the price moves beyond this tolerance before execution, the transaction fails to protect the trader from excessive loss. Slippage in Uniswap refers to the difference between the expected price of a trade and the actual price at which it is executed. It occurs due to price impact and liquidity constraints in the pool.
notion image
 

5.Impermanent Loss & Risks for Liquidity Providers

Providing liquidity isn’t risk-free. If the price of one token in the pair changes significantly, LPs may suffer impermanent loss—a temporary loss compared to simply holding the assets.
However, trading fees can sometimes offset this loss, making liquidity provision profitable over time.
 

Version evolution from V1 to V4

Uniswap has undergone multiple upgrades from v1 to v4, each bringing significant improvements in efficiency, capital utilization, and user experience. Below is a structured comparison of the key changes:
Version
Release Year
Key Features
Limitations
Uniswap v1
2018
- Basic AMM (Automated Market Maker) model. - ETH as an intermediary for all token swaps (e.g., to swap DAI for USDC, users first converted DAI → ETH → USDC). - Fully decentralized, permissionless trading.
- High slippage for large trades. - Limited liquidity due to ETH-only pairs. - No fee distribution to liquidity providers (LPs).
Uniswap v2
2020
- ERC20 to ERC20 swaps, eliminating ETH dependency. - Price oracles using time-weighted averages. - Flash swaps, allowing users to borrow assets within a single transaction. - Fee model introduced: 0.3% fee shared with LPs
- Impermanent loss still a major risk. - Capital inefficiency (liquidity spread thinly across all price ranges)
Uniswap v3
2021
- Concentrated liquidity, allowing LPs to allocate funds to specific price ranges. - Improved capital efficiency: More liquidity available at active price ranges. - Multiple fee tiers (0.05%, 0.3%, 1%) to accommodate different risk levels. - NFT-based LP positions instead of fungible LP tokens.
- Higher complexity for liquidity providers. - Impermanent loss remains a challenge. - Gas fees on Ethereum still high.
Uniswap v4
2024
- “Hooks” system, allowing developers to customize pool behaviors (e.g., dynamic fees, on-chain limit orders). - Singleton contract, reducing gas costs by consolidating multiple pools into one. - Native support for custom AMMs beyond the classic constant product formula. - Flash accounting, reducing unnecessary token transfers and improving efficiency.
- Still in development; potential risks with custom hooks. - Governance and security challenges with increased programmability.
 

Participant Experience Analysis

1.Traders

Pain Points: High fees on CEXs, lack of access to certain tokens, KYC (Know Your Customer) friction. Solution: Direct token swaps with lower barriers to entry, albeit with gas fees on Ethereum.

2.Liquidity Providers (LPs)

Pain Points: Impermanent loss, unpredictable returns. Solution: Fee-sharing mechanism and continuous innovation (e.g., Uniswap v3’s concentrated liquidity) to improve capital efficiency.

3.Developers & Projects

Pain Points: Costly listing fees on CEXs, complex integration with existing financial systems. Solution: Open-source smart contracts allow seamless token listing and integration with DeFi protocols.
 

Reference