Uniswap V1 vs V2 vs V3

Blockscribers Staff
Blockscribers
Published in
5 min readOct 10, 2021

--

Uniswap versions comparison

Introduction

DeFi is the best product of blockchain so far and is the wild west of cryptocurrency. It allows the users to access an open and permissionless system of financial applications with no tedious procedures, KYC, and downtime. This is what disrupted the existing centralized financial systems and brought revolutionized the sectors of finance and investments. Uniswap is one of the leading decentralized cryptocurrency exchanges to surpass traditional financial bodies like banks. With the increase in its user base, Uniswap launches successive versions with updated protocols. The latest version is Uniuswap v3, and this article is about an overview of all the three versions and how they differ.

Uniswap v1 — An overview

Uniswap v1 was launched on the Ethereum Mainnet on Nov 2, 2018. Before the advent of Uniswap, EtherDelta was the only DEX that was having a considerable user base. But it was based on a traditional order-book model, which does not provide ideal decentralization due to lack of liquidity and poor user experience. Here the trading of assets requires proper matching of buy/sell orders between the traders. The order remains unexecuted if the sell order does not match the existing buy orders, affecting the liquidity.

Uniswap, on the other hand, is based on Automated Market Making (AMM) protocol. There is no need to order books here. The trades are against smart contracts or liquidity pools, and a mathematical formula determines the price of assets. The liquidity providers add liquidity to the pools that help to make a market.

In Uniswap liquidity pools, the ratio of the trading asset pairs should be constant. The mathematical expression is

X * Y = K

Where,

X — Reserve of the first asset

Y — Reserve of the second asset

The liquidity providers should add liquidity in such a way that K experiences no change.

Uniswap V1 working flow

Uniswap v1 only supports the swapping of ETH-ERC 20 pairs. If the user wishes to swap USDC for DAI, the first step would be swapping USDC for ETH, succeeded by the swapping of ETH-DAI to get DAI. Uniswap v1 also facilitates the concept of LP tokens. When the Liquidity Providers (LPs) add liquidity to any pool, they receive LP tokens representing the added liquidity. These LP tokens can then be staked or burned to redeem rewards. A 0.3% trading fee is incurred to reward the liquidity providers.

Uniswap v2 — Explained

The Uniswap v1’s Proof-of-Concept was a great hit, and this boosted the network to launch an updated version of Uniswap v2 in May 2020. The major drawback with the Uniswap v1 was the “ETH bridging” problem, i.e., the absence of ERC20-ERC20 token pools. This resulted in escalated costs and high slippage when a user wants to swap one ERC20 token.

Uniswap v2 is way better than v1 in user interface and experience. Also, it eliminated the ETH bridging problem by letting in the concept of ERC20-ERC20 pools. Another significant difference is the usage of wrapped ETH in the core contracts instead of native ETH. However, the traders can use ETH through helper contracts.

Uniswap v2’s Flash swap

Uniswap v2 working flow

Uniswap v2’s concept of flash swap allows the users to withdraw any amount of ERC20 tokens without having to pay upfront. But they could either pay for the tokens withdrawn or pay for a portion and return the rest or return all the withdrawn tokens. These things can be done at the end of the transaction execution.

Uniswap v2 also introduced a protocol fee. Community governance plays a vital role in turning on/off of this fee. A protocol fee of 0.05% of the total 0.3% trading fee will be reserved for the development of the Uniswap platform that shapes the roadmap of the network.

Uniswap v3 — The latest version

The latest version, Uniswap v3, is expected to be aired on May 5, 2021. Uniswap v3, when compared to v1 and v2, provides better capital efficiency and accuracy. The fee structure is very flexible. The Liquidity providers can get high returns on their capital to provide liquidity with 4000x capital efficiency compared to v2. The main aim of Uniswap v3 is to surpass stablecoin-based AMMs and centralized exchanges by facilitating low-slippage trade execution.

Features of Uniswap v3

Concentrated Liquidity

Concentrated Liquidity illustrated

The liquidity providers can estimate the shape of the AMM as they can build unique price curves based on their preferences. LPs’ capital can be centralized within custom price ranges, enhancing the liquidity at desired prices.

Liquidity is active

When the market experiences price change and goes beyond the LP’s specified price range, the liquidity is automatically removed from the pool and will no longer earn rewards. The liquidity will be shifted to the less valuable asset while waiting for the market to arrive at the specified price range. It ensures the wellbeing of the liquidity providers in the Uniswap trading ecosystem. At the same time, LPs can update their price range to meet the current market price range to start getting rewards again.

Flexible fee

Uniswap v1 had a flat fee of 0.3%, and the entire fee was allocated for rewarding LPs. In Uniswap v2, 0.05% of the total fee was reserved for the development of the network. Uniswap v3 arrives at community governed flexibility through three various fee tiers:

⦁ Stablecoins like DAI/USDC has a fee of 0.05%

⦁ Standard non-correlated pools like ETH/DAI incurs a fee of 0.3%

⦁ And 1.00% for the non-correlated pairs

By default, the protocol fee is off. But it can be turned on through governance for particular pools, and the fee can be set between 10%-25% of LP fees.

--

--

Blockscribers Staff
Blockscribers

Scribing blockchain beautifully. Read our exclusive coverage of blockchain articles at https://www.blockscribers.com/