Looking back at the evolution of UNI versions, how has UNI influenced blockchain?

YBB Capital
2024-10-17 20:44:59
Collection
For Web3, I believe there are three important historical moments: Bitcoin pioneered decentralized system blockchain, Ethereum's smart contracts provided imagination beyond blockchain payments, and UNI decentralized financial privileges, sounding the horn for the golden age of blockchain. From V1 to V4, from UNI X to UNIChain, how far is UNI from the ultimate answer of Dex?

Author: YBB Capital Researcher Zeke

Introduction

For Web3, I believe there are three crucial historical moments: Bitcoin pioneered decentralized system blockchain, Ethereum's smart contracts opened up the imagination beyond blockchain payments, and UNI decentralized financial privileges, sounding the horn for the golden age of blockchain. From V1 to V4, from UNI X to UNI Chain, how far is UNI from the ultimate answer for Dex?

UNI V1: Prelude to the Golden Age

There were on-chain exchanges before UNI, but only after UNI could on-chain exchanges be called decentralized exchanges (Dex). Many articles attribute UNI's success to its simplicity, security, privacy, and being the pioneer of AMM; however, in my view, apart from simplicity, UNI's success is not significantly related to other factors. Unlike what most people know today, UNI was not the first on-chain exchange to adopt the AMM model; Bancor (the second-largest ICO project in blockchain history) existed before UNI, and exchanges using on-chain order book models had long been established. UNI was neither a pioneer nor the only on-chain exchange capable of achieving privacy and security; why could UNI take the lead? Let's first discuss Bancor, which was a leading on-chain exchange before UNI. In the early days, the popular EOS RAM and IBO (where B refers to the Bancor protocol) used algorithms or protocols provided by Bancor for asset issuance. The well-known constant product market maker (CPMM) was also first practiced by Bancor.

As for why Bancor later lost to UNI, there are many explanations in the materials I reviewed, some say it was due to U.S. regulatory issues, others say the user experience was not as simple as UNI, and deeper analyses compare algorithms and protocol mechanisms. We won't delve too deeply into these issues here because, in my understanding, the logic behind UNI's rise is quite simple: it was the first Dex project that met the definition of DeFi. The AMM model was the only way at that time to democratize market-making and asset issuance; on-chain order book models or hybrid exchanges could never allow users to freely list tokens, and on the other hand, users could not participate in market-making or provide liquidity to profit, leading to a general lack of trading pairs and slow transaction matching in such projects. Similarly, Bancor, which also adopted the AMM model, failed due to rigid liquidity and the need for Bancor's project team to approve token issuance and pay listing fees. This project essentially still operated around the interests of centralized entities, failing to truly return "privileges" to users.

In my view, the early versions of UNI were indeed not user-friendly. There were significant short-term price fluctuations (one of the inherent problems of CPMM, where large instant trades could manipulate token prices temporarily), slippage due to the inability to directly swap between ERC20 tokens, high gas costs, no slippage protection, and a lack of various advanced features. Although AMM solved the liquidity shortage and slow transaction matching issues under the order book model at that time, it was still not comparable to Cex. The early users of version V1 were also not many, but its significance was historical. It was the first manifestation of financial democratization in Dex, an exchange with no listing barriers, an exchange where liquidity came from the masses. It is precisely because of UNI's existence that Meme Tokens can be so prevalent today, and some projects without top-tier team backgrounds can shine on-chain; some privileges that once belonged only to large financial institutions now exist in every corner of the blockchain.

UNI V2: DeFi Summer

The UNI V2 version was born in May 2020. Compared to today's "DeFi giants," the TVL of UNI V1 at that time was less than 40M. The improvements in V2 focused on the main shortcomings of V1, such as the short-term price manipulation and the need to use ETH as an intermediary for token exchanges mentioned above. In addition, a flash swap mechanism was introduced to enhance overall usability. The most noteworthy aspect of this version is UNI's approach to solving price manipulation. UNI first introduced a block-end price determination mechanism, using the price of the last transaction in each block as the price for that block. This means that attackers must complete their transactions at the end of the previous block and complete arbitrage in the next block. To achieve this, attackers must be able to perform selfish mining (i.e., concealing blocks and not broadcasting them to the network) and continuously mine two blocks; otherwise, the price will be corrected by other arbitrageurs, which is nearly impossible in practice, significantly increasing the cost and difficulty of attacks. Another point is the introduction of time-weighted average price (TWAP), which does not simply take the average price of the last few blocks but weighs the average based on the duration of each price. For example, if the prices of a token pair in the last three blocks were:

  • Block 1: Price 10, Duration 15 seconds

  • Block 2: Price 12, Duration 17 seconds

  • Block 3: Price 11, Duration 16 seconds

Then the value at the end of Block 3 would be: 10 * 15 + 12 * 17 + 11 * 16 = 488. To calculate the TWAP for these three blocks, it would be 488 / (15 + 17 + 16) ≈ 11.11. Through this weighted average, short-term price fluctuations have a smaller impact on the final TWAP, and attackers need to manipulate prices for a longer duration to affect TWAP, making the cost of attacks higher and more difficult.

This approach can also be seen as an early effective way to combat MEV; in addition, it made AMM safer and more reliable, and UNI gradually became the mainstream choice for on-chain Dex. After discussing internal improvements, let's talk about external factors. UNI's rise during this period also had a certain element of luck. A key event occurred in June 2020, officially marking the beginning of the golden age of blockchain, commonly referred to as DeFi Summer. This event was triggered by the lending platform Compound Finance starting to reward both borrowers and lenders with Comp tokens, leading other projects to follow suit, thus bringing about what is known as "yield farming" or "liquidity mining" investment opportunities (what we now refer to as point is actually a rogue version of liquidity mining). As a Dex with a very low barrier to entry for listing tokens and the ability to actively add liquidity, UNI naturally became the first choice for various altcoin projects to mine, with "gold miners" breaking through barriers reminiscent of the California Gold Rush in the mid-19th century. The influx of crazy liquidity allowed UNI to firmly secure its position at the top of DeFi (the peak TVL of UNI v2 exceeded $10 billion on April 29, 2021). From then on, DeFi gained immense popularity, and blockchain began to enter the mainstream.

UNI V3: The Long Road to Competing with Cex

By the time of V2, UNI had already become the standard answer for AMM-type Dex. It can be said that 99% of similar projects from that era had core architectures similar to UNI. At this point, UNI's enemy may no longer be Dex but Cex. Compared to the efficiency of centralized exchanges, a significant problem with AMM is its low capital utilization. For ordinary users, providing liquidity for non-stablecoin trading pairs carries a significant risk of impermanent loss; for example, during the DeFi summer of 2020-2021, it was common for users to see their principal wiped out in pursuit of liquidity mining rewards. If one wants to continue profiting as an LP, the best choice is naturally stablecoin trading pairs, such as DAI-U, which leads to a significant portion of the funds in TVL having little actual utility. On the other hand, V2's liquidity was uniformly distributed across all price ranges from 0 to ∞, even if some price ranges had never been reached, liquidity was still spread across them, which is a manifestation of low capital utilization in V2.

To address this issue, in V3, UNI introduced concentrated liquidity. Unlike V2, where liquidity was evenly distributed across the entire price range, V3 allows LPs to concentrate their funds within specific price ranges they choose. LPs' funds are only utilized within the chosen price range rather than being spread across the entire price curve. This allows LPs to provide the same liquidity depth with less capital or provide greater liquidity depth with the same amount of capital. This approach should be particularly beneficial for stablecoin trading pairs that operate within narrow ranges.

However, in practice, the effectiveness of V3 has not been as good as expected. The reality is that most people choose to provide liquidity in the price ranges where they expect the most price volatility. This means that these high-yield ranges will see a large influx of funds, causing capital accumulation, while other ranges still lack liquidity. Although the capital utilization efficiency of individual LPs has improved, the overall distribution of funds remains uneven and does not significantly improve the low capital utilization problem seen in V2. In terms of liquidity efficiency, it is not as good as the price box proposed by Trader Joe during the same period, and in terms of optimizing stablecoin trading, it is not as good as Curve. Furthermore, with Layer 2 about to emerge, order book model Dexs are likely to regain a high position. At this point, UNI has not yet realized its dream of conquering Cex and has instead fallen into an awkward "midlife crisis."

UNI V4: The Era of Many Hooks

UNI v4 is a significant update that occurred two years after V3. We have provided a more detailed analysis in our previous research reports, and I will briefly state it here. Compared to the V3 version from two years ago, the core of V4 lies in its pursuit of customization and efficiency. The V3 version introduced a concentrated liquidity mechanism to improve capital utilization, but the need for LPs to precisely select price ranges presents certain limitations, making it easy to face liquidity shortages in extreme market conditions. In contrast, the Curve protocol and Trader Joe mentioned earlier provide better options.

The update advantages of V4 lie in achieving the best balance between customization and efficiency, aiming to surpass both in precision and capital utilization. Among them, the most important Hooks (also smart contracts) mechanism grants developers unprecedented flexibility, allowing them to insert custom logic at key points in the liquidity pool's lifecycle (e.g., before/after trades, LP deposits/withdrawals). This enables developers to create highly customized liquidity pools, such as supporting time-weighted average market makers (TWAMM), dynamic fees, on-chain limit orders, and interactions with lending protocols.

On the other hand, V4 adopts a Singleton structure to replace the Factory-Pool architecture that has been in use since V1, concentrating all liquidity pools in a single smart contract, allowing developers to build more Lego-like components. This greatly reduces the gas costs of creating liquidity pools and cross-pool trading (up to 99% reduction) and introduces a "Flash Accounting" system to further optimize gas efficiency. As an update at the end of the bear market in 2023, UNI v4 has significantly regained its position, which had been gradually disadvantaged in the AMM competition. However, the high degree of customization in V4 also brings some issues. For example, developers need to possess stronger technical skills to fully utilize the Hooks mechanism and must design carefully to avoid security vulnerabilities. Additionally, highly customized liquidity pools may lead to market fragmentation, reducing overall liquidity. In summary, V4 represents an important direction in the development of DeFi protocols—highly customized and efficient automated market-making services.

UNI Chain: Towards Maximum Efficiency

UNI Chain is a major update recently announced, symbolizing that the future direction of Dex may be to become a public chain (though I am puzzled that UNI Chain is not an application chain). UNI Chain is built on Optimism's OP Stack, with the core goal of enhancing transaction speed and security through innovative mechanisms, ultimately capturing the protocol's value to reward UNI token holders. Its core innovations are reflected in three aspects:

  1. Verifiable Block Construction: Utilizing Rollup-Boost technology in collaboration with Flashbots, combined with Trusted Execution Environment (TEE) and Flashblocks mechanisms, to achieve fast, secure, and verifiable block construction, reducing MEV risks, improving transaction speed, and providing rollback protection;

  2. UNIchain Verification Network (UVN): Incentivizing validators to participate in block verification through UNI token staking, addressing the centralization risk of a single sequencer and enhancing network security;

  3. Intent-Driven Interaction Model (ERC-7683): Simplifying user experience, automatically selecting the optimal cross-chain transaction path, addressing liquidity fragmentation and inter-chain interaction complexity, compatible with OP Stack and non-OP Stack chains;

In simple terms, it focuses on anti-MEV, decentralized sequencers, and intent-centered user experience. UNI becoming a member of the super chain will undoubtedly strengthen the power of the OP alliance again; however, this is not good news for Ethereum in the short term, as the divergence of the core protocol (UNI accounts for 50% of Ethereum's transaction fees) will further exacerbate the fragmentation of Ethereum. But in the long run, this may be an important opportunity to validate Ethereum's rent-seeking model.

Conclusion

Currently, as the infrastructure for DeFi applications becomes overly saturated, more and more Dex are beginning to shift towards order book models. AMM, no matter how simple, cannot surpass the performance of order book models, and in terms of capital utilization, AMM will never be higher than order books. So will AMM disappear in the future? Some believe that AMM is merely a product of a special era, but I believe AMM has become a totem of Web3. As long as Memes exist, AMM will exist; as long as there is a bottom-up demand, AMM will exist. One day in the future, we may see UNI being surpassed, or even UNI launching an order book, but I believe this totem will always remain.

On the other hand, today's UNI is also becoming more centralized, with governance being "vetoed" by a16z and charging fees on the front end without informing the community. It must be acknowledged that the development approach of Web3 is at odds with human nature and reality; how should we coexist with these suddenly grown giants?

References

  1. UNIswap Documentation

  2. Revisiting the Bancor Algorithm: Why cw is a Failed Design

  3. UNIswapX Research Report: Summarizing the Development Path of V1-3, Interpreting the Principles and Innovations of the Next Generation DEX

  4. UNIswap: From Zero to Infinity

  5. YBB Capital: Saying Goodbye to Fork Swap, Is UNIswap V4 Entering the "Era of Many Hooks"?

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators