Author: YBB Capital Researcher Zeke
Foreword
For Web3, I think there are three most important historical moments: Bitcoin pioneered the decentralized system blockchain, Ethereum's smart contract gave blockchain imagination beyond payment, and UNI decentralized financial privileges and sounded the clarion call of the golden age of blockchain. From V1 to V4, from UNI X to UNI Chain, how far is UNI from the ultimate answer to Dex?
UNI V1: The prelude to the golden age
Before UNI, there were on-chain exchanges, but after UNI, on-chain exchanges can be called decentralized exchanges (Dex). Many articles attribute UNI's success to simplicity, security, privacy, and the pioneer of AMM. In fact, in my opinion, apart from simplicity, UNI's success is not closely related to other factors. Unlike what most people know today, UNI is not the first on-chain exchange to adopt the AMM model. Before UNI, there was Bancor (the second largest ICO project in the history of blockchain), and exchanges that adopted the on-chain order book model have long existed. UNI is neither the pioneer nor the only on-chain exchange that can achieve privacy and security. Why can UNI strike back? Let's first talk about Bancor, which was born earlier than UNI. The project was once a top-level on-chain exchange in the currency circle. EOS RAM and IBO (B refers to the Bancor protocol), which were very popular in the early years, both used the algorithms or protocols provided by Bancor for asset issuance. The constant product market maker (CPMM) we are familiar with was also first practiced by Bancor. As for why Bancor later lost to UNI, there are many opinions in the information I have read. Some say it is a problem of US supervision, and some say that the user experience is not as simple as UNI. There are also some in-depth issues such as the comparison of algorithms and protocol mechanisms. We will not elaborate on these issues here, because, in my understanding, the logic behind UNI's success is very simple. It is the first Dex project that meets the definition of DeFi. The use of the AMM model was the only way to democratize market makers and asset issuance at that time. The on-chain order book model or the mixed on-chain and off-chain exchanges would never allow users to list tokens at will. On the other hand, users could not participate in market making or provide liquidity to make profits, which led to the lack of trading pairs and slow transaction matching in this type of project. Bancor, which also uses the AMM model, failed because of its rigid liquidity and the fact that the issuance of tokens requires the consent of the Bancor project party and the payment of listing fees. In essence, this project still operates around the interests of centralized entities and does not truly return the "privilege" to users.
The early version of UNI is not really easy to use in my eyes. The short-term price fluctuations are huge (one of the inherent problems of CPMM, through instantaneous large transactions, the token price can also be manipulated by attackers in a short time), the slippage caused by the inability to directly exchange between ERC20, the high gas cost, no slippage protection, and the lack of various advanced functions. Although AMM solved the problem of lack of liquidity and slow transaction matching in Dex under the order book model at that time, it is destined not to compete with Cex. There are not many early users of the V1 version, but its significance is historic. It is the first manifestation of financial democratization in Dex, an exchange with no threshold for listing coins, and an exchange with liquidity from the public. It is precisely because of the existence of UNI that Meme Token can be so popular today, and some projects without top team backgrounds can also shine on the chain. Some privileges that once belonged only to large financial institutions also exist in every corner of the blockchain today.
UNI V2: DeFi Summer 2020 year In May, compared to today's "DeFi behemoth", the TVL of UNI V1 was less than 40M. The improvements of the V2 version focus on the main shortcomings of V1, such as the short-term price manipulation mentioned above and the need for token exchange to be transferred in ETH. In addition, a flash exchange mechanism is introduced to improve overall practicality. The most noteworthy thing in this version is UNI's idea of solving price manipulation. UNI first introduced a price determination mechanism at the end of the block, which takes the price of the last transaction in each block as the price of the block. That is to say, the attacker must complete the transaction at the end of the previous block and complete the arbitrage in the next block. To achieve this operation, the attacker must be able to complete selfish mining (that is, concealing the block from broadcasting to the network) and mining two blocks in a row, otherwise the price will be corrected by other arbitrageurs, which is almost impossible to complete in actual operation, and the cost and difficulty of the attack are greatly increased. 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 weighted averages according to the duration of each price. Let me give you an example. Suppose the prices of a token pair in the past three blocks are:
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 is: 10 * 15 + 12 * 17 + 11 * 16 = 488. If you want to calculate the TWAP of these three blocks, it is 488 / (15 + 17 + 16) ≈ 11.11. Through this weighted average, short-term price fluctuations have little impact on the final TWAP, and attackers need to manipulate prices for a long time to affect TWAP, which makes the attack more costly and more difficult.
This idea can also be seen as an effective way to fight MEV in the early stage. In addition, it also makes AMM safer and more reliable, and UNI gradually becomes the mainstream choice of Dex on the chain. After talking about internal improvements, let's talk about external reasons. UNI's rise in this period actually has a certain luck factor. A key event occurred in June of 20, which officially opened the golden age of blockchain, which is what we often call DeFi Summer later. The cause of this event was that the lending platform Compound Finance began to reward Comp tokens to both borrowers and lenders, and other projects followed suit, bringing about stacked investment opportunities known as "yield farming" or "liquidity mining" (today's point is actually a rogue version of liquidity mining). As a Dex with a very low threshold for listing and the ability to actively add liquidity, UNI is naturally the first choice for carrying all kinds of copycat projects. The rush of "gold miners" is like the California Gold Rush in the mid-19th century. The crazy influx of liquidity has made UNI the top of DeFi (the peak TVL of UNI v2 exceeded 10 billion US dollars on April 29, 21). So far, DeFi has become famous and blockchain has begun to enter the mainstream.
UNI v3: The long road to fight against Cex
UNI in V2 The version is already the standard answer for AMM-type Dex. It can be said that the core architecture of 99% of similar projects in that era is almost the same as UNI. At this time, UNI's enemy may no longer be Dex, but Cex. Compared with the high efficiency of centralized exchanges, a big problem with AMM is the low utilization rate of funds. For ordinary users, there is a great risk of impermanent loss in providing liquidity for non-stable currency trading pairs. For example, in the DeFi summer of 20-21, it is common to return the principal to zero in order to obtain liquidity mining income. If you want to continue to make profits in LP, the best choice is naturally stable currency trading pairs, such as DAI-U, which means that a considerable part of the funds in TVL have little practical utility. On the other hand, the liquidity of V2 is evenly covered in all price ranges from 0 to ∞. Even if some price ranges have never occurred, liquidity is also covered on them. This is a manifestation of low capital utilization in V2.
To solve this problem, UNI introduced Concentrated Liquidity in the V3 version. Unlike V2, where liquidity is evenly distributed throughout the price range, V3 allows LPs to concentrate their funds in a specific price range of their choice. LP funds are only used within the price range, rather than being dispersed across the entire price curve. This allows LPs to provide the same liquidity depth with less funds, or provide greater liquidity depth with the same funds. This approach should be particularly beneficial for stablecoin trading pairs that trade in a narrow range.
But in specific cases, V3 is not as effective as expected. The reality is that most people will choose to provide liquidity in the range with the largest expected price fluctuations. This means that these high-yield ranges will be flooded with funds, causing capital deposition, while other ranges will still lack liquidity. Although the efficiency of fund utilization of a single LP has been improved, the overall distribution of funds is still uneven, and it will not significantly improve the problem of low fund utilization efficiency in V2. In terms of liquidity efficiency, it is not as good as the price box proposed by Trader Joe in the same period, and in terms of stablecoins, it is not as good as Curve in terms of transaction optimization. And with the emergence of Layer2, Dex, which is mainly based on the order book model, is likely to occupy a high position again. At this time, UNI has not yet realized the dream of conquering Cex, but has fallen into the embarrassment of a "midlife crisis".
UNI V4: Ten Thousand Hooks
UNI v4 is a major update two years after V3. This has been analyzed in more detail in our previous research reports, and I will only briefly state it here. Compared with the V3 version two years ago, the core of V4 lies in its pursuit of customization and efficiency. The V3 version needs to introduce a centralized liquidity mechanism to improve the efficiency of capital utilization, but the trading position requires LP to accurately select the price range, which has certain limitations and may face the problem of insufficient liquidity in extreme market conditions. Compared with this, the Curve protocol and Trader Joe mentioned above provide better options.
The update advantage of the V4 version is that it can achieve the best balance between customization and efficiency, in order to achieve accuracy and capital utilization that exceeds both. Among them, the most important Hooks (also smart contract) mechanism gives developers unprecedented flexibility, allowing developers to insert custom logic at key points in the life cycle of the liquidity pool (such as before/after transactions, LP deposits/withdrawals). This allows 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 uses the Singleton structure to replace the Factory-Pool architecture that V1 has been using to this day, concentrating all liquidity pools in a smart contract so that developers can build more Lego blocks of their own. This greatly reduces the Gas cost of creating liquidity pools and cross-pool transactions (can be reduced by 99%), and introduces the "Flash Accounting" system to further optimize Gas efficiency. As an update at the end of the 23-year bear market, UNI v4 has greatly recovered its position of being gradually at a disadvantage in the AMM competition. However, the high degree of customization of V4 also brings some problems. For example, developers need to have stronger technical capabilities to make full use of the Hooks mechanism, and need to design carefully to avoid security vulnerabilities. In addition, highly customized liquidity pools may also lead to market fragmentation and reduce overall liquidity. In short, V4 represents an important direction for the development of DeFi protocols - highly customized and efficient automated market maker services.
UNI Chain: Towards the Most Efficient
UNI Chain It is a major update announced recently, and it also symbolizes that the future direction of Dex may be to become a public chain (but what puzzles me is that UNI Chain is not an application chain). UNI Chain is built on Optimism's OP Stack. The core goal of this chain is to improve transaction speed and security through innovative mechanisms, and ultimately capture the value of the protocol itself and give back to UNI token holders. Its core innovations are reflected in three aspects:
Verifiable block construction: Utilizing Rollup-Boost technology in cooperation with Flashbots, combined with Trusted Execution Environment (TEE) and Flashblocks mechanism, fast, secure and verifiable block construction is achieved, MEV risks are reduced, transaction speeds are increased and rollback protection is provided;
UNIchain Verification Network (UVN): Through UNI token staking, validators are incentivized to participate in block verification, solving the centralization risk of a single sorter and improving network security;
Intent-driven interaction model (ERC-7683): Simplifies user experience, automatically selects the optimal cross-chain transaction path, solves the problems of liquidity fragmentation and complexity of inter-chain interactions, and is compatible with OP Stack and non-OP Stack chains;
In short, it is anti- MEV, decentralized sorter, intent-centered user experience. UNI becoming a member of the super chain will undoubtedly make the OP Alliance stronger again. However, this is bad news for Ethereum in the short term. The deviation of the core protocol (Uni accounts for 50% of Ethereum's transaction fees) will make the fragmented Ethereum worse again. But in the long run, this may be an important opportunity to verify the Ethereum rental model.
Conclusion
At present, with the overflow of infrastructure performance for DeFi applications, more and more Dex are turning to the order book model. AMM is simple, but it only requires an order book model with performance, and AMM will never be higher than the order book in terms of capital utilization. Will AMM disappear in the future? Some people think that AMM is just a product of a special era, but I think AMM is already a totem of Web3. As long as Meme exists, AMM will exist, and as long as the bottom-up demand is still there, AMM will exist. One day in the future, we may see UNI surpassed, or even UNI launch an order book, but I believe this totem will remain forever.
On the other hand, today's UNI has also begun to become centralized. It was "vetoed" by a16z in governance, and charged fees on the front end without informing the community. One thing we have to admit is that the development of Web3 is contrary to human nature and reality. How should we coexist with these giants that have suddenly grown? This is a question we all have to think about.