For Web3, I believe there are three significant historical moments: Bitcoin pioneering decentralized blockchain systems, Ethereum’s smart contracts expanding the possibilities of blockchain beyond payments, and UNI decentralizing financial privileges, heralding the golden age of blockchain. From V1 to V4, and from UNI X to UNI Chain, how far is UNI from the ultimate answer for DEX?
Before UNI, there were on-chain exchanges, but only after UNI could they be truly called decentralized exchanges (DEX). Many articles attribute UNI’s success to its simplicity, security, privacy, and its pioneering of the Automated Market Maker (AMM) model. However, apart from simplicity, I believe UNI’s success is not significantly related to these other factors. Contrary to what many are familiar with today, UNI was not the first on-chain exchange to adopt the AMM model; Bancor, which had the second-largest ICO in blockchain history, existed before UNI. Additionally, exchanges utilizing on-chain order book models had already been established.
UNI was neither a pioneer nor the only on-chain exchange capable of achieving privacy and security. So, why could UNI emerge victorious? Let’s first consider Bancor, which was once a leading on-chain exchange in the crypto space. In its early days, projects like EOS RAM and Initial Bounty Offerings (IBO) (with “B” referring to the Bancor protocol) utilized algorithms or protocols provided by Bancor for asset issuance. The constant product market maker (CPMM) model, widely recognized today, was also first practiced by Bancor.
As for why Bancor later fell behind UNI, there are many theories in the materials I reviewed. Some attribute it to regulatory issues in the U.S., while others point to a less straightforward user experience compared to UNI. A deeper analysis would compare algorithms and protocol mechanisms. However, I won’t delve too much into these issues here because, in my view, the logic behind UNI’s rise is straightforward: it was the first DEX project that aligned with 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 (on-chain and off-chain) could not allow users to freely list tokens. Moreover, users couldn’t participate in market-making or provide liquidity for profit, leading to a common problem of a lack of trading pairs and slow trade execution. On the other hand, Bancor, which also adopted the AMM model, failed due to liquidity stagnation and the requirement for Bancor’s approval for token issuance, along with a listing fee. This project essentially still operated around the interests of a centralized entity, failing to genuinely return “privileges” to users.
I find that the early versions of UNI were not particularly user-friendly. They experienced significant short-term price volatility (one of the inherent issues of CPMM, where large instantaneous trades could manipulate token prices), slippage due to the inability to directly swap ERC20 tokens, high gas costs, no slippage protection, and a lack of advanced features. While AMM resolved the liquidity shortages and slow trade execution of DEXs under order book models, it was still not on par with centralized exchanges (CEX). The early users of version 1 were few, but its significance was historic. It represented the first manifestation of financial democratization in DEXs—a trading platform with no listing thresholds and liquidity sourced from the public.
Thanks to UNI, Meme Tokens have flourished today, allowing projects without top-tier team backgrounds to shine on-chain. Privileges once exclusive to large financial institutions now exist in every corner of the blockchain.
UNI V2 was launched in May 2020, and compared to today’s “DeFi giants,” the TVL (Total Value Locked) of UNI V1 was less than $40 million at that time. The improvements in V2 focused on addressing the main weaknesses of V1, such as short-term price manipulation and the need for token exchanges to go through ETH. Additionally, the introduction of flash swaps enhanced the overall usability of the platform.
A noteworthy aspect of UNI’s approach to solving price manipulation was the introduction of the block-end price determination mechanism, where the price of each block is set based on the last transaction in that block. This means that an attacker would have to complete a transaction at the end of the previous block and execute an arbitrage in the next block. To achieve this, the attacker would need to perform selfish mining (concealing the block without broadcasting it to the network) and continuously mine two blocks; otherwise, the price would be corrected by other arbitrageurs. This makes the operation nearly impossible in practice, significantly increasing the attack cost and difficulty.
Another improvement was the introduction of the Time-Weighted Average Price (TWAP). This mechanism does not simply average the prices of the last few blocks but instead weighs them according to the duration each price lasted. For example, if the prices of a token pair over 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
The calculated value at the end of Block 3 would be: 10 15 + 12 17 + 11 * 16 = 488. The TWAP for these three blocks would be 488 / (15 + 17 + 16) ≈ 11.11. This weighted average means that brief price fluctuations have a minimal impact on the final TWAP, requiring attackers to manipulate prices over an extended period to affect TWAP, which raises the attack cost and difficulty.
This approach can also be seen as an early effective method to combat MEV (Miner Extractable Value). Additionally, it made AMMs safer and more reliable, gradually positioning UNI as a mainstream choice for on-chain DEXs.
Aside from internal improvements, UNI’s rise during this period was also partly due to luck. A key event in June 2020 marked the beginning of the golden age of blockchain, commonly referred to as DeFi Summer. This event was initiated when the lending platform Compound Finance began rewarding both borrowers and lenders with COMP tokens, prompting other projects to follow suit. This led to what is known as “yield farming” or “liquidity mining,” creating stacked investment opportunities (today’s point model is considered a rogue version of liquidity mining). As a DEX with low listing thresholds and the ability to actively add liquidity, UNI naturally became the top choice for various altcoin projects seeking to mine.
The influx of liquidity was reminiscent of the California Gold Rush in the mid-19th century, allowing UNI to firmly establish its position as the leader in DeFi (the peak TVL of UNI V2 exceeded $10 billion on April 29, 2021). By this point, DeFi had gained widespread recognition, and blockchain began to enter the mainstream.
By the V2 version, UNI had already become the standard answer for AMM-type DEXs. It can be said that 99% of similar projects during that era had core architectures closely resembling UNI. At this point, UNI’s perceived enemy might no longer be other DEXs but centralized exchanges (CEXs). One major issue with AMMs, compared to the efficiency of CEXs, is their low capital utilization. For regular users, providing liquidity for non-stablecoin trading pairs carries a significant risk of impermanent loss. For example, during the DeFi summer of 2020-2021, many users lost their principal due to seeking liquidity mining rewards. To continue profiting as liquidity providers (LPs), the best choice was often stablecoin trading pairs, like DAI-U, leading to a substantial portion of TVL (Total Value Locked) being of little actual utility.
Additionally, V2’s liquidity was uniformly spread across the entire price range from 0 to ∞. Even if certain price ranges never experienced trades, liquidity was still allocated to those ranges, reflecting the low capital utilization of V2.
To address this issue, UNI introduced concentrated liquidity in the V3 version. Unlike V2, where liquidity was evenly distributed across the entire price range, V3 allowed LPs to concentrate their funds within specific price ranges of their choosing. LP funds would only be utilized within those chosen ranges rather than being dispersed along the entire price curve. This enabled LPs to provide the same liquidity depth with less capital or to provide greater liquidity depth with the same amount of capital. This approach was particularly advantageous for stablecoin trading pairs that traded within narrow ranges.
However, the actual performance of V3 did not meet expectations. Most users opted to provide liquidity in the price ranges where they anticipated the greatest price fluctuations. This led to substantial capital accumulation in those high-yield ranges while leaving other ranges still lacking liquidity. While the capital efficiency for individual LPs improved, the overall distribution of funds remained uneven, failing to significantly enhance the low capital utilization issues seen in V2. In terms of liquidity efficiency, it was outperformed by Trader Joe’s proposed price boxes during the same period and was less optimized for stablecoin trading compared to Curve.
Moreover, with the emergence of Layer 2 solutions, order book-based DEXs were poised to reclaim a dominant position. At this time, UNI had yet to fulfill its ambition of conquering CEXs and instead found itself in an awkward “midlife crisis.”
UNI V4 was a significant update that occurred two years after V3, and while previous reports provide a more detailed analysis, I will summarize the key points here. Compared to the V3 version from two years ago, V4’s core focus is on customization and efficiency. While V3 introduced concentrated liquidity mechanisms to enhance capital utilization, LPs faced limitations as they needed to accurately select price ranges, which could lead to insufficient liquidity in extreme market conditions. In contrast, Curve and Trader Joe offered better alternatives.
The main advantage of V4 lies in achieving an optimal balance between customization and efficiency, aiming for improved precision and capital utilization beyond what either V3 or competing protocols can offer. A crucial feature is the Hooks mechanism, which provides developers with unprecedented flexibility, allowing them to insert custom logic at key points in the liquidity pool’s lifecycle (such as before/after trades or during LP deposits/withdrawals). This enables developers to create highly customized liquidity pools, supporting features like time-weighted average market makers (TWAMM), dynamic fees, on-chain limit orders, and interactions with lending protocols.
Additionally, V4 adopted a Singleton structure to replace the Factory-Pool architecture carried over from V1. This change centralizes all liquidity pools within a single smart contract, allowing developers to build more modular components. This significantly reduces the gas costs associated with creating liquidity pools and cross-pool transactions (by up to 99%) and introduces a “Flash Accounting” system that further optimizes gas efficiency. As an update toward the end of the bear market in 2023, UNI V4 greatly improved its competitive position in the AMM landscape.
However, the high level of customization in V4 also brings certain challenges. Developers need stronger technical skills to fully leverage the Hooks mechanism and must carefully design their implementations to avoid security vulnerabilities. Moreover, 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—offering highly customized and efficient automated market maker services.
UNI Chain is a significant recent update that symbolizes the potential future direction of DEXs toward becoming public chains (though it’s puzzling that UNI Chain is not an application chain). Built on Optimism’s OP Stack, the core goal of UNI Chain is to enhance transaction speed and security through innovative mechanisms, ultimately capturing the protocol’s value to benefit UNI token holders. Its core innovations are:
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 speeds, and providing rollback protection.
UNIchain Verification Network (UVN): Incentivizing validators to participate in block verification through UNI token staking, addressing the centralization risks of a single sequencer and enhancing network security.
Intent-driven interaction model (ERC-7683): Simplifying user experience by automatically selecting the optimal cross-chain transaction paths, addressing liquidity fragmentation and the complexities of inter-chain interactions, while being compatible with both OP Stack and non-OP Stack chains.
In short, it focuses on MEV resistance, decentralized sequencing, and an intent-centered user experience. As UNI becomes part of a super chain, it undoubtedly strengthens the OP Alliance. However, this may not bode well for Ethereum in the short term; the divergence of core protocols (with UNI accounting for 50% of Ethereum’s transaction fees) could exacerbate Ethereum’s fragmentation. In the long run, though, this might represent an important opportunity to validate Ethereum’s rent model.
Currently, as the infrastructure overwhelms the performance of DeFi applications, more and more DEXs are shifting to an order book model. AMMs, while simple, can never achieve the same capital efficiency as order books. So, will AMMs disappear in the future? Some believe that AMMs are merely a product of a specific era, but I think AMMs have become a totem of Web3. As long as memes exist, AMMs will persist; as long as there is a bottom-up demand, AMMs will remain. One day in the future, we might see UNI being surpassed, or even UNI launching an order book, but I believe this totem will endure.
On the other hand, UNI is also becoming more centralized today. Governance has been subject to a16z’s “veto power,” and fees are charged at the front end without informing the community. We must acknowledge that the development path of Web3 often diverges from human nature and reality. How do we coexist with these suddenly grown giants? This is a question we all need to contemplate.
For Web3, I believe there are three significant historical moments: Bitcoin pioneering decentralized blockchain systems, Ethereum’s smart contracts expanding the possibilities of blockchain beyond payments, and UNI decentralizing financial privileges, heralding the golden age of blockchain. From V1 to V4, and from UNI X to UNI Chain, how far is UNI from the ultimate answer for DEX?
Before UNI, there were on-chain exchanges, but only after UNI could they be truly called decentralized exchanges (DEX). Many articles attribute UNI’s success to its simplicity, security, privacy, and its pioneering of the Automated Market Maker (AMM) model. However, apart from simplicity, I believe UNI’s success is not significantly related to these other factors. Contrary to what many are familiar with today, UNI was not the first on-chain exchange to adopt the AMM model; Bancor, which had the second-largest ICO in blockchain history, existed before UNI. Additionally, exchanges utilizing on-chain order book models had already been established.
UNI was neither a pioneer nor the only on-chain exchange capable of achieving privacy and security. So, why could UNI emerge victorious? Let’s first consider Bancor, which was once a leading on-chain exchange in the crypto space. In its early days, projects like EOS RAM and Initial Bounty Offerings (IBO) (with “B” referring to the Bancor protocol) utilized algorithms or protocols provided by Bancor for asset issuance. The constant product market maker (CPMM) model, widely recognized today, was also first practiced by Bancor.
As for why Bancor later fell behind UNI, there are many theories in the materials I reviewed. Some attribute it to regulatory issues in the U.S., while others point to a less straightforward user experience compared to UNI. A deeper analysis would compare algorithms and protocol mechanisms. However, I won’t delve too much into these issues here because, in my view, the logic behind UNI’s rise is straightforward: it was the first DEX project that aligned with 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 (on-chain and off-chain) could not allow users to freely list tokens. Moreover, users couldn’t participate in market-making or provide liquidity for profit, leading to a common problem of a lack of trading pairs and slow trade execution. On the other hand, Bancor, which also adopted the AMM model, failed due to liquidity stagnation and the requirement for Bancor’s approval for token issuance, along with a listing fee. This project essentially still operated around the interests of a centralized entity, failing to genuinely return “privileges” to users.
I find that the early versions of UNI were not particularly user-friendly. They experienced significant short-term price volatility (one of the inherent issues of CPMM, where large instantaneous trades could manipulate token prices), slippage due to the inability to directly swap ERC20 tokens, high gas costs, no slippage protection, and a lack of advanced features. While AMM resolved the liquidity shortages and slow trade execution of DEXs under order book models, it was still not on par with centralized exchanges (CEX). The early users of version 1 were few, but its significance was historic. It represented the first manifestation of financial democratization in DEXs—a trading platform with no listing thresholds and liquidity sourced from the public.
Thanks to UNI, Meme Tokens have flourished today, allowing projects without top-tier team backgrounds to shine on-chain. Privileges once exclusive to large financial institutions now exist in every corner of the blockchain.
UNI V2 was launched in May 2020, and compared to today’s “DeFi giants,” the TVL (Total Value Locked) of UNI V1 was less than $40 million at that time. The improvements in V2 focused on addressing the main weaknesses of V1, such as short-term price manipulation and the need for token exchanges to go through ETH. Additionally, the introduction of flash swaps enhanced the overall usability of the platform.
A noteworthy aspect of UNI’s approach to solving price manipulation was the introduction of the block-end price determination mechanism, where the price of each block is set based on the last transaction in that block. This means that an attacker would have to complete a transaction at the end of the previous block and execute an arbitrage in the next block. To achieve this, the attacker would need to perform selfish mining (concealing the block without broadcasting it to the network) and continuously mine two blocks; otherwise, the price would be corrected by other arbitrageurs. This makes the operation nearly impossible in practice, significantly increasing the attack cost and difficulty.
Another improvement was the introduction of the Time-Weighted Average Price (TWAP). This mechanism does not simply average the prices of the last few blocks but instead weighs them according to the duration each price lasted. For example, if the prices of a token pair over 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
The calculated value at the end of Block 3 would be: 10 15 + 12 17 + 11 * 16 = 488. The TWAP for these three blocks would be 488 / (15 + 17 + 16) ≈ 11.11. This weighted average means that brief price fluctuations have a minimal impact on the final TWAP, requiring attackers to manipulate prices over an extended period to affect TWAP, which raises the attack cost and difficulty.
This approach can also be seen as an early effective method to combat MEV (Miner Extractable Value). Additionally, it made AMMs safer and more reliable, gradually positioning UNI as a mainstream choice for on-chain DEXs.
Aside from internal improvements, UNI’s rise during this period was also partly due to luck. A key event in June 2020 marked the beginning of the golden age of blockchain, commonly referred to as DeFi Summer. This event was initiated when the lending platform Compound Finance began rewarding both borrowers and lenders with COMP tokens, prompting other projects to follow suit. This led to what is known as “yield farming” or “liquidity mining,” creating stacked investment opportunities (today’s point model is considered a rogue version of liquidity mining). As a DEX with low listing thresholds and the ability to actively add liquidity, UNI naturally became the top choice for various altcoin projects seeking to mine.
The influx of liquidity was reminiscent of the California Gold Rush in the mid-19th century, allowing UNI to firmly establish its position as the leader in DeFi (the peak TVL of UNI V2 exceeded $10 billion on April 29, 2021). By this point, DeFi had gained widespread recognition, and blockchain began to enter the mainstream.
By the V2 version, UNI had already become the standard answer for AMM-type DEXs. It can be said that 99% of similar projects during that era had core architectures closely resembling UNI. At this point, UNI’s perceived enemy might no longer be other DEXs but centralized exchanges (CEXs). One major issue with AMMs, compared to the efficiency of CEXs, is their low capital utilization. For regular users, providing liquidity for non-stablecoin trading pairs carries a significant risk of impermanent loss. For example, during the DeFi summer of 2020-2021, many users lost their principal due to seeking liquidity mining rewards. To continue profiting as liquidity providers (LPs), the best choice was often stablecoin trading pairs, like DAI-U, leading to a substantial portion of TVL (Total Value Locked) being of little actual utility.
Additionally, V2’s liquidity was uniformly spread across the entire price range from 0 to ∞. Even if certain price ranges never experienced trades, liquidity was still allocated to those ranges, reflecting the low capital utilization of V2.
To address this issue, UNI introduced concentrated liquidity in the V3 version. Unlike V2, where liquidity was evenly distributed across the entire price range, V3 allowed LPs to concentrate their funds within specific price ranges of their choosing. LP funds would only be utilized within those chosen ranges rather than being dispersed along the entire price curve. This enabled LPs to provide the same liquidity depth with less capital or to provide greater liquidity depth with the same amount of capital. This approach was particularly advantageous for stablecoin trading pairs that traded within narrow ranges.
However, the actual performance of V3 did not meet expectations. Most users opted to provide liquidity in the price ranges where they anticipated the greatest price fluctuations. This led to substantial capital accumulation in those high-yield ranges while leaving other ranges still lacking liquidity. While the capital efficiency for individual LPs improved, the overall distribution of funds remained uneven, failing to significantly enhance the low capital utilization issues seen in V2. In terms of liquidity efficiency, it was outperformed by Trader Joe’s proposed price boxes during the same period and was less optimized for stablecoin trading compared to Curve.
Moreover, with the emergence of Layer 2 solutions, order book-based DEXs were poised to reclaim a dominant position. At this time, UNI had yet to fulfill its ambition of conquering CEXs and instead found itself in an awkward “midlife crisis.”
UNI V4 was a significant update that occurred two years after V3, and while previous reports provide a more detailed analysis, I will summarize the key points here. Compared to the V3 version from two years ago, V4’s core focus is on customization and efficiency. While V3 introduced concentrated liquidity mechanisms to enhance capital utilization, LPs faced limitations as they needed to accurately select price ranges, which could lead to insufficient liquidity in extreme market conditions. In contrast, Curve and Trader Joe offered better alternatives.
The main advantage of V4 lies in achieving an optimal balance between customization and efficiency, aiming for improved precision and capital utilization beyond what either V3 or competing protocols can offer. A crucial feature is the Hooks mechanism, which provides developers with unprecedented flexibility, allowing them to insert custom logic at key points in the liquidity pool’s lifecycle (such as before/after trades or during LP deposits/withdrawals). This enables developers to create highly customized liquidity pools, supporting features like time-weighted average market makers (TWAMM), dynamic fees, on-chain limit orders, and interactions with lending protocols.
Additionally, V4 adopted a Singleton structure to replace the Factory-Pool architecture carried over from V1. This change centralizes all liquidity pools within a single smart contract, allowing developers to build more modular components. This significantly reduces the gas costs associated with creating liquidity pools and cross-pool transactions (by up to 99%) and introduces a “Flash Accounting” system that further optimizes gas efficiency. As an update toward the end of the bear market in 2023, UNI V4 greatly improved its competitive position in the AMM landscape.
However, the high level of customization in V4 also brings certain challenges. Developers need stronger technical skills to fully leverage the Hooks mechanism and must carefully design their implementations to avoid security vulnerabilities. Moreover, 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—offering highly customized and efficient automated market maker services.
UNI Chain is a significant recent update that symbolizes the potential future direction of DEXs toward becoming public chains (though it’s puzzling that UNI Chain is not an application chain). Built on Optimism’s OP Stack, the core goal of UNI Chain is to enhance transaction speed and security through innovative mechanisms, ultimately capturing the protocol’s value to benefit UNI token holders. Its core innovations are:
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 speeds, and providing rollback protection.
UNIchain Verification Network (UVN): Incentivizing validators to participate in block verification through UNI token staking, addressing the centralization risks of a single sequencer and enhancing network security.
Intent-driven interaction model (ERC-7683): Simplifying user experience by automatically selecting the optimal cross-chain transaction paths, addressing liquidity fragmentation and the complexities of inter-chain interactions, while being compatible with both OP Stack and non-OP Stack chains.
In short, it focuses on MEV resistance, decentralized sequencing, and an intent-centered user experience. As UNI becomes part of a super chain, it undoubtedly strengthens the OP Alliance. However, this may not bode well for Ethereum in the short term; the divergence of core protocols (with UNI accounting for 50% of Ethereum’s transaction fees) could exacerbate Ethereum’s fragmentation. In the long run, though, this might represent an important opportunity to validate Ethereum’s rent model.
Currently, as the infrastructure overwhelms the performance of DeFi applications, more and more DEXs are shifting to an order book model. AMMs, while simple, can never achieve the same capital efficiency as order books. So, will AMMs disappear in the future? Some believe that AMMs are merely a product of a specific era, but I think AMMs have become a totem of Web3. As long as memes exist, AMMs will persist; as long as there is a bottom-up demand, AMMs will remain. One day in the future, we might see UNI being surpassed, or even UNI launching an order book, but I believe this totem will endure.
On the other hand, UNI is also becoming more centralized today. Governance has been subject to a16z’s “veto power,” and fees are charged at the front end without informing the community. We must acknowledge that the development path of Web3 often diverges from human nature and reality. How do we coexist with these suddenly grown giants? This is a question we all need to contemplate.