What is the Difference Between Uniswap V1, V2, and V3?

Written by blockscribers | Published 2022/01/14
Tech Story Tags: uniswap | defi-top-story | uniswap-guide | blockchain | ethereum | liquidity | defi | technology

TLDRUniswap is one of the leading decentralized cryptocurrency exchanges out there. It’s one of the first exchanges to truly give traditional financial bodies like banks a run for their money. With the increase in its user base, Uniswap has launched successive versions with updated protocols.via the TL;DR App

Uniswap is one of the leading decentralized cryptocurrency exchanges in existence.

It’s one of the first exchanges to truly give traditional financial institutions (like banks) a run for their money.

With the increase in its user base, Uniswap has launched successive versions with updated protocols.

Introduction

DeFi is one of the most progressive ideas out there for why to use blockchain technology.

It is currently the ‘wild West’ of the finance world. DeFI makes it possible for users to access an open and permissionless system of financial applications with no tedious procedures, KYC protocols, and downtime.

DeFi is what disrupted the existing centralized financial systems and revolutionized sectors of finance and investments.

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 had 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.

In the traditional order-book model, 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. 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

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

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 Flash Swap

Uniswap V2’s concept of Flash Swap allows 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 this fee on or off. 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

Uniswap V3, when compared to V1 and V2, has better capital efficiency and accuracy. Furthermore, the fee structure is very flexible.

The Liquidity providers can get high returns on their capital and provide liquidity. 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

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.

Previously published here.


Written by blockscribers | Scribing blockchain beautifully! Blockchain is for everyone and so is Blockscribers.
Published by HackerNoon on 2022/01/14