BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

Uniswap Evolution History: Opportunities and Impacts of V4

Cycle Trading
特邀专栏作者
2023-06-22 02:00
This article is about 4642 words, reading the full article takes about 7 minutes
Imaginative experiments will happen on Uniswap V4.
AI Summary
Expand
Imaginative experiments will happen on Uniswap V4.

Original author: Yilan, LD Capital

Uniswap V0

Original author: Yilan, LD Capital

Uniswap V1 launched in November 2018. However, in fact, in the previous year, the prototype of Uniswapd has been formed. In 2017, the founder Hayden resigned from Siemens. Karl, a friend working at the Ethereum Foundation, comforted Hayden, "Mechanical engineering is a sunset industry, and Ethereum is the future." Under the guidance of Karl, Hayden learned about Ethereum and Solidity, In November 2017, he created his Proof-of-something (Proof of concept AMM as they named it), which is Uniswap V0. This image shows what Uniswap looked like from the very beginning.

Uniswap V1

Before the official launch of V1, Hayden was working on V0 using Balance and MakerDao's office. At the end of July 2018, Uniswap officially received the Grant from the Ethereum Foundation.

first level title

In September 2019, Uniswap V1 launched the first liquidity mining project, which is the liquidity mining based on ERC-20 tokens. During the V1 period, the transaction volume was relatively small, and the user scale was relatively small. As the first version of the Uniswap protocol. V1 uses an Automated Market Maker (AMM) based mechanism that allows users to trade permissionless tokens on the Ethereum blockchain without an order book. A constant product model is adopted, i.e. x*y=k, where x and y are the balances of the two tokens in the trading pair.

Uniswap V2

The innovative mechanism of Uniswap V1 enables users to conduct token transactions quickly and conveniently without relying on traditional centralized exchanges; it laid the foundation for subsequent versions of Uniswap and became an inspiration for other AMM protocols. But in fact, the Uniswap V1 version at that time did not attract many users.

first level title

The most significant change of Uniswap V2 on the basis of Uniswap V1 is the introduction of multiple token pair transactions, increasing the flexibility of transaction pairs, and upgrading from ERC-20 that can only be exchanged with ETH to support ERC-20 to ERC-20 exchange. Additionally, significant improvements to the time-weighted average price (TWAP) oracle introduced with Uniswap V2.

Uniswap V3

The launch of Uniswap V2 strengthens Uniswap's position in the field of decentralized exchanges. It provides more functions and flexibility, allowing users to better manage liquidity and conduct more types of transactions. Uniswap V2 has also contributed to the rapid development of decentralized finance (DeFi), providing users with an important source of liquidity.

first level title

Launched in May 2021, Uniswap V3 introduced the concept of "Concentrated Liquidity". It allows liquidity providers to define specific price ranges within trading pairs for more precise price control. This provides liquidity providers with greater transaction fee gains and reduces opportunities for arbitrageurs to take advantage of price differences.

Additionally, Uniswap V2 uses the standard 0.3% transaction fee, while V3 offers 3 separate fee tiers: 0.05%, 0.3%, and 1%. This allows liquidity providers to select pools based on the risk they are willing to take. V3 introduced the model of using NFT as LP to provide proof of liquidity for the first time, that is, the provided liquidity is tracked by non-homogeneous ERC 721 tokens.

Uniswap V4The launch of Uniswap V3 has had a major impact in the DeFi ecosystem. It provides liquidity providers with more choices and better income opportunities, while improving transaction efficiency. Uniswap V3 also drives innovation in decentralized exchanges and leads the efforts of other exchanges and protocols to improve user experience and reduce transaction costs. But at the same time, passive liquidity providers have been criticized for being squeezed out of the fee income space by JIT and professional market makers.

— Hooks change everything

Hooks

Once the white paper draft of Uniswap V4 was launched, the market fully interpreted it. It mainly mentions optimizations such as Hook, Singleton, Flash Accounting and native ETH, among which Hook is the most important innovation of V4. The Hook of Uniswap V4 may become the most powerful tool for liquidity construction. In the future, the cost of building a DeFi platform and combining liquidity will be greatly reduced.

secondary title

In simple terms, the Hooks contract is a contract that calls other smart contracts, and the logic executed in the transaction life cycle. These logics can be implemented by user-defined contracts and called at critical moments.

Specifically, the Hooks contract can be called at the following key points:

· onSwap: Called when the exchange occurs, it can be used to implement custom logic, such as recording transaction information, performing specific operations or modifying transaction fees, etc.

· onMint: Called when the liquidity provider adds liquidity to the pool, it can be used for custom logic, such as recording relevant information provided by liquidity or performing specific operations.

  • · onBurn: Called when the liquidity provider withdraws liquidity from the pool, it can be used for custom logic, such as recording relevant information provided by liquidity or performing specific operations.

  • The previous version of liquidity pool developers can only customize LP and LP fee, and V4 Hooks allows developers to make more innovations based on Uniswap's liquidity and security, allowing developers to set more custom behaviors, Uniswap Labs showcased the following range of possibilities, revealing unique characteristics of the product, including:

  • Time Weighted Average Based Market Maker (TWAMM)

  • Dynamic commission based on volatility or other values

  • On-chain limit order

  • Out-of-scope liquidity deposit lending agreement

  • Automatically reinvest LP handling fee to LP position

Built-in MEV (miner extractable value) profit distribution to LP

secondary title

The relationship between the optimization of Uniswap V4 and the unpaid loss (IL)

In fact, these optimizations further strengthen capital efficiency while strengthening the position of Uniswap's liquidity infrastructure, but the problem of uncompensated loss (IL) of centralized liquidity is still prominent.

  • IL is an endogenous adjunct problem of AMM, as long as the two asset prices deviate from the initial price, IL will be generated. For the centralized liquidity mechanism of Uni V3, V4 (and other similar liquidity management protocols), the IL problem itself is more serious due to the high Gamma in a narrow range, which may be more significant in some scenarios, such as high volatility market or when the correlation between assets providing liquidity is low.

  • Regarding IL, there are currently the following solutions, but they all only indirectly alleviate this problem:

  • For example, using protocol token subsidies. Liquidity providers can stake with their liquidity. By staking these tokens, liquidity providers can obtain additional rewards or compensation to offset potential temporary losses. These rewards can be provided in the form of additional tokens or a portion of protocol transaction fees.

  • Implement a dynamic fee structure that adjusts fees based on market conditions and temporary loss levels experienced by liquidity providers. Charge higher fees during periods of significant temporary losses and distribute these additional fees as compensation to liquidity providers.

  • The platform can set up an insurance fund to compensate liquidity providers for any losses suffered due to temporary losses. These funds are typically raised through various revenue streams within the protocol or through contributions from the platform itself.

  • Hedging mechanism (options, etc.), liquidity providers can participate in derivative contracts or use other financial instruments to hedge their exposure to price fluctuations and mitigate the impact of temporary losses.

Dynamic asset rebalancing aims to optimize the exposure of liquidity providers and reduce potential losses by continuously adjusting asset allocation according to price fluctuations and market conditions.

It can be seen that Uniswap V4's dynamic handling fees, more optimized oracle prices, and more LP subsidies (MEV subsidies, automatic reinvestment handling fees, etc.) all indirectly compensate LP's IL loss to some extent.

Singleton

secondary title

Flash accounting

A quick bookkeeping system complements Singleton. In V4, the system no longer transfers assets into and out of the liquidity pool at the end of each exchange, but only transfers on the net balance. This design makes the system more efficient and can provide additional gas savings in Uniswap V4.

Native ETH

first level title

text

In the previous version, the user was actually trading with WETH. ETH is not a Token Contract but WETH is a Token Contract. For Uniswap, the ERC 20 contract is easier to integrate, so each time the user Swap needs to pack ETH an extra time, changing ETH to Into WETH, this step leads to gas waste. V4 restores support for native ETH, further saving Gas overhead.

The potential impact and opportunities of Uniswap V4 on other tracks

1) Aggregator track

From the perspective of the aggregator market, Uniswap V4 provides better rates, higher capital efficiency, and a huge liquidity pool integrated by Singleton, which will attract more from the aggregator market (1inch, Cowswap), which is the track of rolling rates. High transaction volume.

3) CEX

2) Customized DEX and similar liquidity customization function agreement

The impact of Onchain Limit Orders, customized liquidity distribution, dynamic rate, etc. on existing Dex with similar functions, including the LP yield enhanced vault on Uni V3. The liquidity of the product agreement is drawn away seems to be a foreseeable result, these The agreement may face the situation of joining if it can't win, and eventually become a part of the Uniswap V4 ecosystem. For future DEX or other DeFi protocols, it may fundamentally change its liquidity construction model. The Hook of Uniswap V4 may become the most powerful tool for liquidity construction, and the cost of building a DeFi platform and combining liquidity will be greatly reduced .

For centralized exchanges, due to the price limit function and the orthodoxy of decentralization, Uniswap V4 may be able to gain more market share from the hit CEX. But in fact, compared with CEX, the biggest problem that hinders users from entering DEX is that the speed and efficiency are not as good as CEX, and many times, for most people, the early threshold of using DEX and the sacrifice of contract security for decentralization Sex and other risks, so that users need to bear relatively high costs. To put it simply, low efficiency and unusability require the improvement and solution of the DEFI infrastructure, and the V4 version cannot effectively solve it at present. After solving these two problems, the road for DEX to replace CEX will be smoother.

4) MEV track

When it cannot bring benefits to the platform core Stake holder (LP&Swapper), MEV and the protocol are in opposition.

In previous versions, Uniswap V1 had no built-in mechanism specifically designed to prevent or mitigate MEV (miner-extractable value), causing miners or validators to gain extra profits by manipulating the order of transactions in the blockchain network to the detriment of users Benefit.

To help mitigate MEV, Uniswap V2 introduces a “price oracle” feature, an external price source that provides reliable and tamper-proof asset price information. By relying on price oracles, Uniswap V2 aims to prevent front-running attacks, in which traders take advantage of block confirmation time delays to manipulate prices for profit.

Uniswap V3 introduces several features to mitigate MEV, including the concepts of centralized liquidity and non-homogeneous liquidity (NFT LP positions). Centralized liquidity allows liquidity providers to specify price ranges for their liquidity, reducing the risk of price manipulation. Non-homogeneous liquidity positions allow liquidity providers to have fine-grained control over their liquidity, reducing the risk of being squeezed or exploited by arbitrageurs.

In Uniswap V4, the internalized MEV allocation mechanism presents opportunities for MEV developers who want to occupy a favorable role in the V4 pool.

5) Oracle track

The TWAP of Uniswap V2 is an on-chain oracle machine, which can be applied to obtain the price of any Token existing on Uniswap. The main defect is that it needs to be triggered by an off-chain program to update the price regularly, and there is maintenance cost.

Regarding the impact on the oracle track, the manipulation cost of Uniswap’s TWAP oracle is to control the average price of tokens over a period of time. In contrast, Chainlink’s cost of manipulation is disrupting enough nodes and manipulating prices on exchanges. Therefore, Chainlink is an off-chain oracle, and the built-in oracle of Uniswap V4 will not pose a threat to Chainlink for the time being. For Uniswap's ecological projects (such as lending, stable coins, synthetic assets, etc.), the participation of off-chain oracles like Chainlink is still required.

Summarize

first level title

Summarize

In general, the direction of Uniswap V4 is moving towards the real infrastructure of DeFi, and imaginative experiments for developers can happen on Uniswap V4.

For LPs, adding liquidity will be more customized and convenient. For users, it is cheaper to create a transaction pool, and transactions have more options. For example, using V2, V3, and V4 has its own advantages. The contract of V2 is simple and the transaction of a single pool is cheap; the structure of V4 is complex, but it can help users save a lot of gas costs when multiple pools need to be called.

Developer
DeFi
Uniswap
Oracle
MEV
Welcome to Join Odaily Official Community