Analysis and Comparison of Uniswap V3 and V4

IntermediateApr 02, 2024
As a leading decentralized exchange, Uniswap is about to launch its fourth version (V4), bringing significant changes in liquidity provision and on-chain token trading. This article explores the new features, advantages, and disadvantages of Uniswap V3 and V4 and their impact on users. It provides a comprehensive analysis and comparison of Uniswap V3 and V4, helping users navigate the DeFi market seamlessly.
Analysis and Comparison of Uniswap V3 and V4

Introduction

Source: Uniswap

Uniswap has released its latest governance proposal, planning to distribute protocol fees proportionally to holders who have staked UNI Tokens, leading to a surge of up to 80% on the day. The Snapshot vote for this proposal is scheduled to be released on March 1, 2024, and the on-chain vote will start on March 8, 2024.

One of the reasons this governance proposal significantly impacted the price of UNI is that UNI holders have previously felt their returns were low. The importance of this proposal lies in its redistribution of protocol fees, giving UNI more practical benefits. As the fees generated by Uniswap are second only to Ethereum on-chain transfers, this empowering effect significantly impacts the appreciation of UNI.

As the industry develops and technology continues to evolve, Uniswap V3 has also faced some limitations and challenges. To address these challenges and further improve the protocol, the Uniswap team has launched Uniswap V4. This is not only a technical upgrade to V3 but also a further contribution and development to the DeFi ecosystem. The following content will explain the background of V3 and the highlights of V4.

Application of Uniswap V3

Uniswap V3, launched in May 2021, aims to address the issues of capital efficiency and liquidity concentration. Its feature allows liquidity providers to choose a specific price range for asset usage, thereby improving capital utilization and increasing fee income. It introduces multiple fee tiers (0.05%, 0.30%, and 1.00%) to handle different risk and trading volume situations, better adapting to market dynamics and user needs.

Uniswap V3 integrates the Ethereum layer 2 solution, Optimism, reducing transaction fees and enhancing platform scalability. This leads to faster transactions and lower costs. Additionally, it introduces the Non-Fungible Liquidity (NFL) feature, enabling liquidity providers to obtain NFTs representing their share in the liquidity pool. Users can trade, sell, or transfer their liquidity positions without affecting the assets in the pool.

What are the Highlighted New Features of Uniswap V4?

Source: Google Images

With the expected arrival of Ethereum’s Cancun upgrade (Dencun) in March, Uniswap has also announced that V4 will be officially launched in Q3 of 2024. According to the Uniswap Foundation, Uniswap V4 will be the most rigorously examined code in Ethereum’s history. It will be launched in three stages: finalizing the code, auditing and testing the network, and launching it on the mainnet.

Although Uniswap V4 has not been officially launched, a series of potential functions and improvements have been revealed through the publication of the whitepaper and draft code, which include:

Hooks and Custom Pools

Uniswap V4 introduces a new feature that allows anyone to customize its operation according to their needs. By understanding Hooks, we can understand that each liquidity pool has its lifecycle, including key stages such as creation, addition, removal, or liquidity adjustment. Hooks allow developers to execute specific operations at key points in the pool’s lifecycle.

For example, by adding Hooks, developers can make liquidity pools natively support dynamic fees, add on-chain limit orders, or act as a time-weighted average market maker (TWAMM), which distributes large orders over different time points to minimize the impact on price.

Hooks have a broad application scope. They can be used with various on-chain oracles, take advantage of unused liquidity, and interact with lending protocols. This gives developers the flexibility to build customized liquidity pools that meet their specific needs. This versatility makes Hooks a potentially powerful tool, offering developers limitless creativity and flexibility.

Singleton

In Uniswap V3, each liquidity pool needs to deploy a new contract, which makes creating pools and performing multi-pool swaps more expensive.

In Uniswap V4, a significant change has been made where the same contract manages all pools. This change leads to significant savings in fuel costs as swaps no longer require token transfers between pools held in different contracts. Uni estimates that Uniswap V4 will reduce pool creation fuel costs by 99%. This change will make using Uniswap V4 more economical and efficient.

Flash Accounting

The singleton design introduced in Uniswap V4 complements a structural change called flash accounting.

In previous versions of Uniswap, actions like token swaps or adding liquidity to pools were typically executed by transferring tokens. However, in Uniswap V4, external transactions are only executed at the end of the operation. This simplifies pool operations and reduces associated costs.

Introducing singleton and flash accounting has achieved a more efficient multi-pool path. The advantage of this structure is that it is very practical, considering that introducing Hooks will increase the number of liquidity pools.

Native ETH Trading Pairs

Uniswap V4 will reintroduce native ETH in trading pairs.

In Uniswap V1, only ETH/ERC-20 token pairs were supported. Native ETH trading pairs were removed in Uniswap V2 due to the complexity of implementation and concerns about liquidity fragmentation for WETH and ETF trading pairs.

Uniswap V2 and Uniswap V3 require most users to wrap ETH into WETH before trading on the Uniswap protocol, an action that results in additional gas costs.

With the introduction of singleton and flash accounting, Uniswap V4 now allows WETH and ETH trading pairs. Considering that the fuel cost of native ETF transfers (21k gas) is about half that of ERC-20 transfers (40k gas), this will bring real savings to users.

Comparison of Uniswap V3 and V4

Feature Characteristics

Uniswap V3 introduced capital efficiency optimization and multiple fee levels, enhancing the capital utilization of liquidity providers.

Uniswap V4 improves operational convenience and cost-effectiveness and introduces new features, such as Hooks and singleton design.

Transaction Costs

Uniswap V3’s fee structure is more complex, determined by the fee level chosen for the transaction.

Uniswap V4’s fee structure is simplified, and all pool contracts are consolidated into one contract, reducing transaction costs.

Liquidity Management

Uniswap V3 allows liquidity providers to choose a specific price range, improving capital utilization.

Uniswap V4 introduces a singleton design, meaning liquidity providers no longer need to create a new contract for each trading pair, thus enhancing liquidity management efficiency.

Contract Structure

In Uniswap V3, each liquidity pool has its contract, leading to many contracts.

In Uniswap V4, all liquidity pools are managed by a single contract, significantly reducing the number and management costs of contracts.

Uniswap V4 Advantages, Disadvantages and Benefits

Advantages

Cost efficiency: Uniswap V4 introduces a singleton design, integrating all liquidity pool contracts into one, thus reducing the cost of creating and managing liquidity pools.

Increased flexibility: V4 introduces a new feature, Hooks, that allows developers to perform more flexibly on liquidity pools according to their needs, enhancing the protocol’s flexibility and scalability.

Improved liquidity management efficiency: The singleton design means that liquidity providers do not need to create new contracts for each trading pair, thereby enhancing the efficiency of liquidity management and increasing the capital utilization rate.

Native ETH trading pairs: V4 reintroduces ETH trading pairs, allowing users to trade directly with ETH without converting it to WETH, reducing transaction costs.

Disadvantages

Increased learning cost: New users may need to spend some time familiarizing and understanding the new features and concepts introduced in V4.

Increased operational complexity: While V4 offers more features and flexibility, it also increases operational complexity. This might require ordinary users to invest more time and effort to adapt.

Uniswap V4 offers several benefits to its users, including lower transaction costs, increased trading flexibility, efficient liquidity management, and the ability to trade ETH directly without converting it to WETH. These advantages allow users to participate in the DeFi market and trade more easily and conveniently.

Conclusion

As a major participant in the Decentralized Exchange (DEX) sector, Uniswap, launched in 2018, is now entering its fifth year. It is about to launch its fourth version this year, introducing upgraded features.

Uniswap V4’s design introduces substantial changes, notably in liquidity creation and on-chain token trading. Although this open design offers a vast experimental playground for developers, it also complicates the user experience. Users must thoroughly comprehend the workings of liquidity pools and understand each ‘hook’ function before trading with the pool.

Uniswap V4 still has significant potential advantages, and it is bound to have a major impact on the future development of DeFi protocols!

The “Activate Uniswap Protocol Governance” proposal passed with unanimous support, receiving 100% approval. A total of 2,485 voters participated, and the votes in favor reached 55 million UNI. This vote has been one of Uniswap’s most active recent votes.

This proposal was officially opened for on-chain voting on March 8. If approved, Uniswap will implement a fee mechanism to reward users who have authorized and staked UNI tokens. This will allow them to receive a portion of the protocol’s transaction fee revenue.

Author: Allen
Translator: Sonia
Reviewer(s): Edward、Wayne、Elisa、Ashley、Joyce
* The information is not intended to be and does not constitute financial advice or any other recommendation of any sort offered or endorsed by Gate.io.
* This article may not be reproduced, transmitted or copied without referencing Gate.io. Contravention is an infringement of Copyright Act and may be subject to legal action.
Start Now
Sign up and get a
$100
Voucher!
Create Account