Without a shadow of a doubt, Uniswap is the most popular decentralized exchange in the world. Check out this chart from Dune Analytics that measures the number of users per protocol.
No prices for guessing which line is Uniswap! In March 2021, Uniswap underwent a monumental change as it transitioned from V2 to V3. In this blog, let’s do a quick Uniswap V2 vs Uniswap V3 comparison to show you these features.
Uniswap V2 vs Uniswap V3: The History
Established in 2018, Uniswap is a decentralized cryptocurrency exchange built on the Ethereum blockchain. It operates as an automated liquidity protocol, making it completely decentralized. Uniswap is compatible with all ERC-20 tokens, which allows users to trade a wide range of cryptocurrencies and utilize various infrastructure services like wallet providers such as MetaMask and MyEtherWallet.
Uniswap V1 is the first version of the protocol, launched in November 2018 at Devcon 4. A year and a half later, we got Uniswap V2. Uniswap V2 introduced direct ERC-20/ERC-20 pools, flash swaps, and an improved price oracle. In May 2021, Uniswap went through a significant revamp by launching V3.
Uniswap V2 vs Uniswap V3: Liquidity Allocation
What is Uniswap V2 Constant Product
Uniswap uses a constant product function to determine the prices of different cryptocurrencies. It’s like a see-saw that keeps everything balanced. This approach is summarized by the equation x*y=k, where x is the amount of token A in a liquidity pool, y is the amount of token B in a liquidity pool, and k is a constant number.
The amount of Token A and Token B in the pool always has to multiply to the same number. So, if you have more of Token A, you’ll have less of Token B to keep the equation balanced. Anyone can become a “liquidity provider” by putting an equal value of Token A and Token B into the pool. In return, they receive pool tokens that represent their share of the total pool. These tokens can be redeemed for the actual tokens whenever they want.
Let’s take an example.
There’s a pool with 1,000 ETH and 1,000,000 USDC. Initially, the price of 1 ETH is $1000, and the equation’s constant product is 1,000,000,000 (1,000 * 1,000,000 = 1,000,000,000).
Now, imagine someone who wants to trade 5 ETH for USDC. When they take out 5 ETH from the pool, there will be 995 ETH left. To keep the equation balanced, they need to deposit some USDC into the pool. In this case, they would need to deposit around $5,025.13 worth of USDC, so the total amount of USDC in the pool becomes 1,005,025.13.
The equation still holds: 995 * 1,005,025.13 = 1,000,000,000. But because the ratio of ETH to USDC in the pool has changed, the new implied price for 1 ETH would be $1,005.03. The price gets normalized later through arbitrage.
This system ensures that Uniswap prices always move towards the prices on other exchanges, preventing big differences and allowing people to make easy and fair trades.
What is Uniswap V3 Concentrated Liquidity
Instead of a constant product formula, Uniswap V3 uses the concentrated liquidity model. In Uniswap V2, users tend to spread their liquidity across the entire price range. So, if you lock in Ethereum at $1100 and ETH drops to $1050, your liquidity will get used at a loss. With concentrated liquidity, instead of spreading their money across the entire range of prices, liquidity providers can choose to focus it on a specific price range. When traders want to buy or sell cryptocurrency, they can find more liquidity within that specific price range. Liquidity providers (LPs) earn more fees because their money is concentrated in the area where trading activity is happening the most.
But here’s the catch: if the price moves outside of the chosen price range, the LP’s liquidity is no longer active. To help providers choose their price ranges, Uniswap uses something called “ticks,” which are like markers that divide the price range into different sections. Providers can set their boundaries using these ticks. The spacing between ticks determines the cost of swapping, so providers can choose how close or far apart they want their boundaries based on the fees they want to earn.
This approach enhances capital efficiency in Uniswap V3 as all assets are allocated where trading is most likely to occur.
Uniswap V2 vs Uniswap V3: Fees
In Uniswap V2, there is a fixed 0.3% fee applied to every token swap. This fee is divided among the liquidity providers based on their share of the liquidity reserves. When users make swaps, the fees they pay are immediately added to the liquidity reserves. LPs can collect their share of fees by burning their liquidity tokens, which removes a proportionate amount of the underlying reserves.
On the other hand, Uniswap V3 introduces a new approach by offering multiple pools for each token pair, each with its own swapping fee. Initially, liquidity providers can create pools with three different fee levels: 0.05%, 0.30%, and 1%. Additional fee levels can be added through governance decisions, such as the introduction of the 0.01% fee level proposed in November 2021. This gives liquidity providers more flexibility in choosing the fee level that aligns with their preferences and trading strategies.
Uniswap V2 vs Uniswap V3: Liquidity Fungibility
In terms of liquidity representation, Uniswap V2 treats liquidity positions as fungible assets. These positions are represented by ERC20 tokens within the protocol. In contrast, Uniswap V3 introduces non-fungible liquidity positions. This means that LPs can provide liquidity within specific price ranges, and their positions cannot be represented as standard ERC20 tokens within the underlying protocol.
Uniswap V2 vs Uniswap V3: In Closing
Uniswap is a significant achievement in DeFi. Both V2 and V2 offer game-changing protocols. Here is a comparison between the two.
|Uniswap V2||Uniswap V2|
|Liquidity Formula||Constant Product (x*y=k)||Concentrated Liquidity|
|Fees||0.30%||0.01%, 0.05%, 0.30%, and 1%.|
Do you want to interact with Uniswap? Buy some $UNI from CoinSmart.
Disclaimer: The contents of this blog are strictly for information purposes only. The opinions expressed in this blog do not have any connection to CoinSmart, and they do not aim to provide you with investment advice. It is important that you do your personal research and/or consult an investment advisor to determine what is right for you.