Home >web3.0 >What is Uniswap V4?

What is Uniswap V4?

WBOY
WBOYOriginal
2024-07-17 12:32:351098browse

Abstract

  • In June 2023, Uniswap released the code draft of Uniswap V4, proposing major new features of the decentralized exchange platform (DEX) protocol.

  • New features include “pegs” for customizable liquidity pools, a singleton design to improve cross-pool liquidity efficiency, and the return of native ETH trading pairs.

  • Uniswap V4 is expected to offer many benefits, including better customization, greater efficiency, lower gas costs, and improved trading strategies.

  • But Uniswap V4 also has some limitations. For example, Uniswap can charge part of the withdrawal fee, and its license limits the use of source code.

What is Uniswap?

Uniswap is a decentralized exchange (DEX) running on the Ethereum blockchain. Through the platform, users can trade various digital assets using the automated market maker (AMM) model, eliminating the need to use traditional order books.

Ethereum developer Hayden Adams founded Uniswap in 2018, originally inspired by Ethereum co-founder Vitalik Buterin’s concept of on-chain automated market makers.

Uniswap has become the leader in the DEX market with significant trading volume and higher liquidity compared to other DEXs. As of 2023, Uniswap ranks among the best DEXs based on various indicators such as trading volume, liquidity, and active users.

Uniswap has gone through multiple iterations, launching Uniswap V2 in 2020 and Uniswap V3 in 2021. In June 2023, Uniswap released the code draft of Uniswap V4, which contains several major new features.

Before we dive into the new features of Uniswap V4, let’s review past versions of Uniswap to better understand its evolution.

Introduction to Uniswap V1

Uniswap V1 is the initial version, launched as a proof-of-concept platform in November 2018. Its main innovation is the introduction of the constant product market maker (CPMM) model.

Uniswap does not rely on a traditional order book based system, but instead pools all those with idle tokens into specific trading pairs (such as ETH/DAI) and collects from users who trade with the liquidity pool A certain handling fee is paid in return.

Uniswap V1 facilitates token swaps between ERC-20 tokens and Ethereum (ETH). It also allows exchange between two ERC-20 tokens. The process of exchanging between two ERC-20 tokens is a two-step process:

Convert ERC-20 Token 1 to Ethereum (ETH).

Exchange Ethereum (ETH) for ERC-20 tokens2.

This process is necessary because Uniswap V1 smart contracts only support direct liquidity pools between ERC-20 tokens and Ethereum (ETH).

Although Uniswap V1 is groundbreaking, it also has its limitations, including an inefficient pricing algorithm that can be exploited by arbitrageurs, and high sliding spreads for large transactions.

Introduction to Uniswap V2

In order to cope with the challenges faced by Uniswap V1, Uniswap V2 was launched in May 2020 and made a number of key improvements. Uniswap V2 adjusts its AMM model to support direct token-to-token exchanges, thereby reducing slippage and improving capital efficiency.

In addition, V2 also introduces Flash Swap, users can withdraw any amount from the liquidity pool and do anything with these funds, as long as they return the withdrawn amount in the same transaction (plus handling fee). This feature drives the development of arbitrage and provides liquidity mining opportunities without upfront funds.

Uniswap V2 also introduces the concept of Time Weighted Average Price (TWAP), a feature through which other decentralized applications can use Uniswap’s prices more easily and securely.

Introduction to Uniswap V3

Uniswap V3 was launched in May 2021 and is dedicated to solving issues related to capital efficiency and centralized liquidity. With Uniswap V3, liquidity providers can choose to use specific price ranges of their assets, thereby earning higher fees through improved capital utilization.

Uniswap V3 also introduces a fee level system (0.05%, 0.30% and 1.00%) to better correspond to different risk levels and transaction volumes.

Another new feature is non-fungible liquidity (NFL), through which liquidity providers can collect NFTs representing their share of the liquidity pool, and users can do so without affecting the underlying assets in the pool. Trade, sell or transfer their liquidity positions.

Another important feature of Uniswap V3 is the integration with Ethereum Layer 2 solution Optimism, which is designed to reduce transaction fees and improve the scalability of the platform.

What are the new features of Uniswap V4?

While Uniswap V4 has not yet been released, its future features and improvements have been announced in code drafts and white papers. These include:

1. “Pegs” and custom pools

Uniswap V4 will allow everyone to customize by introducing “pegs”, which are contracts that run at different stages of the liquidity life cycle.

To better understand “pegs”, it is important to realize that every liquidity pool has a life cycle from creation to addition, removal or adjustment. "Hooks" allow developers to add code that performs specified actions at key points throughout the pool's lifecycle.

For example, you can allow liquidity pools to support native dynamic fees by adding "pegs", add on-chain price limits, or act as a time-weighted average market maker (TWAMM) to gradually spread out large orders and minimize the price impact.

Customization of liquidity pools via “pegs” can be unlimited, from using multiple on-chain oracles to depositing unused liquidity into lending protocols. Basically, “pegs” will provide developers with significant flexibility in customizing liquidity pools to meet specific needs.

2. Singleton

In Uniswap V3, each liquidity pool deploys a new contract, so the cost of creating a pool and performing multi-pool swaps is higher.

A big change in Uniswap V4 is that all fund pools are stored in one contract. This move saves significant gas costs, as exchanges will no longer require transferring tokens between pools in different contracts. Uniswap estimates that Uniswap V4 can reduce the gas cost of creating a capital pool by 99%.

3. Lightning Accounting

The singleton design is a complement to an architectural change in Uniswap V4 called Lightning Accounting.

In previous versions of Uniswap, token exchange or adding liquidity to the fund pool ended with the transfer of tokens. In Uniswap V4, external transfers are only made at the end, which simplifies the operation of the fund pool and reduces costs.

Single instance and lightning accounting not only improve cross-pool routing efficiency, but also reduce transaction costs. This advantage will be useful considering that the introduction of "pegs" increases the number of liquidity pools.

4. Native ETH trading pairs

Uniswap V4 resumes support for native ETH trading pairs.

As mentioned above, Uniswap V1 only supports ETH/ERC-20 token pairs. In Uniswap V2, the native ETH trading pair was removed due to implementation complexity and concerns about liquidity fragmentation between WETH and ETH trading pairs.

Both Uniswap V2 and Uniswap V3 require the vast majority of users to encapsulate their ETH into WETH before trading on the Uniswap protocol, which requires additional gas fees.

After introducing singletons and lightning accounting, Uniswap V4 supports transactions on both WETH and ETH trading pairs. This will benefit users as native ETH transfers (21,000 gas) are approximately half the gas cost of ERC-20 transfers (40,000 gas).

What are the advantages of Uniswap V4?

Uniswap V4 is committed to providing more possibilities for ways to create liquidity and ways to trade tokens on the chain. Its advantages include:

1. Customization

Developers can add new features to the liquidity pool with great flexibility through "hooks". This is expected to lead to the creation of innovative pools with customized trading capabilities.

2. Efficiency

"Hooks", singleton contracts and lightning accounting can improve the efficiency of transaction routing.

3. Reduced fuel costs

Uniswap V4’s new features are expected to further reduce fuel costs, thereby attracting more users to the protocol.

4. Liquidity providers may increase their income

There may be a dynamic fee structure that provides liquidity providers (LP) with more control and may increase their income.

5. Advanced Trading Strategies

New features such as Time Weighted Average Market Maker (TWAMM), limit orders and dynamic fees enable advanced trading strategies that were not possible in previous versions. This is very attractive for experienced traders.

What are the potential limitations of Uniswap V4?

Uniswap V4 has certain limitations. These include:

1. Fee collection

Uniswap V4 has two independent governance fee mechanisms: exchange fee and withdrawal fee, each mechanism is different. Similar to Uniswap V3, Uniswap governance (Uniswap DAO and UNI token holders) can choose to charge a certain percentage of exchange fees in specific fund pools.

In Uniswap V4, if the "peg" initially chooses to enable withdrawal fees for the fund pool, the governance department can charge the highest percentage of the withdrawal fee.

2. Restricted use license

Uniswap V4 will be released under the Commercial Source Code License 1.1, which limits the use of Uniswap V4 source code in commercial or production environments to four years, at which time it will be converted to the General Public License License (GPL), permanently valid. Therefore, some community members have criticized Uniswap’s latest version as not being a true open source product.

Conclusion

The decentralized exchange platform (DEX) market is constantly developing, and new protocols and platforms are constantly emerging. Uniswap is a dominant player in the DEX space. It was founded in 2018 and released its fourth generation version 5 years later. Each past iteration of the protocol has added new upgrades and improved functionality.

Significant changes in the design of Uniswap V4 are aimed at unleashing the infinite possibilities of DEX. While this open design gives developers virtually unlimited room for experimentation, it can significantly increase the complexity of the user experience. Before interacting with a liquidity pool, users need to carefully study how the pool operates and understand the role of each "peg".

However, the potential advantages of Uniswap V4 should be huge. It is important for users to always do their own research (DYOR) and fully understand the model they are about to adopt.

The above is the detailed content of What is Uniswap V4?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn