DEXes, along with stablecoins, lending services, and trading aggregators, are the critical building blocks of DeFi. However, among these, DEXes have emerged as the most important foundation, serving as the central hub of DeFi. This post shall provide a succinct overview of the generational advancements of DEXes since 2018.
The first generation
1st-gen DEXes emerged between 2018 and 2019 and relied on the reserve model. Under this model, a DEX would maintain a reserve of tokens on a contract, enabling traders to exchange one type of token for another based on a price provided by the DEX developer. This model bears similarities to physical foreign-currency exchange shops. Examples of DEXes that utilized this model during this period include Bancor, Balancer and Kyber in their first versions. However, the reserve model was constrained by liquidity shortages since the reserves were often limited and could even run out. Additionally, these types of DEXes relied on price feed aggregated from centralized exchanges (CEXes). Some others like IDEX, Binance DEX combined centralized order-book with onchain settlement. Howoever, this model did not last for long.
The second generation
2nd-gen of DEXes is based on the constant product or inverse function and liquidity pool model. This model was pioneered by Uniswap, which launched in November 2018 and is founded on a simple mathematical formula of x*y=k, where x and y represent cryptocurrencies in a trading pair, and k is a constant parameter. For mathematical formalization, refer to the relevant literature \cite{uni}. Uniswap was a game-changing protocol as it introduced the Automated Market Making (AMM) mechanism, which subsequently set the trend in DeFi from 2020 to 2021. Other DEXes (Balancer, Kyber, Bancor) followed suit and implemented AMM mechanisms, replacing the reserve model. AMM allows anyone to become a market maker or liquidity provider, and it is easy, permissionless to create any trading pair on Uniswap and swap any amount instantly, providing an infinitely and permanently available liquidity pool for the swap pair. These features are in contrast to the intrinsic limitations of reserve-type DEXes and centralized exchanges (CEXes). Additionally, the on-chain execution nature of Uniswap and AMM-type DEXes ensures transparency and resistance to censorship. From a mathematical standpoint, this DEX model theoretically offers unlimited liquidity, which is impossible for reserve-type DEXes and CEXes based on order-book and pricing matching mechanisms. However, the Uniswap model has limitations, including impermanent loss (IL) and slippage, which had never been encountered before.
The third generation
3rd-gen of decentralized exchanges (DEXes) represent advancements on the previous Uniswap model to reduce slippage and increase capital (liquidity) efficiency by concentrating liquidity and swap requests in specific ranges instead of spreading prices on the entire inverse curve. Uniswap V3 led this improvement, followed by other DEXes. However, liquidity concentration makes the trading experience more complicated and somewhat limits liquid capacity in extreme volatility (e.g. regarding new listed token with low liquidity). An alternative improvement for the constant product formula introduced by Uniswap was the Proactive Market Maker (PMM) algorithm invented by DodoEX. The PMM formula is, in fact, an integral curve of liquidity and price function, offering a more concentrated curve of unlimited liquidity around the current market price. This significantly reduces IL and slippage while multiplying the capital efficiency of the liquidity pool. Unfortunately, DodoEX only works if the (average) market price is fed into its markets, which is not necessary for Uniswap. Curve Finance introduced StableSwap - an efficient mechanism for Stablecoin liquidity. Several projects has also introduced various ways to improve capital efficiency for general token pairs, e.g. Maverick protocol.
Summary
Automated Market Maker (AMM) models have rather matured for spot trading, including the Uniswap model, its variations, and the Proactive Market Maker (PMM) algorithm. While some developers have attempted to reduce the impermanent loss (IL) and slippage through concentration techniques or improving the mathematical curves for liquidity pools, another focus is to build DEXes for trading derivatives, synthetic assets, and perpetual futures or options. This marks the beginning of the fourth evolutionary generation of DEXes. With this advancement, decentralized exchanges are poised to offer a wider range of financial products, making them more competitive with centralized exchanges.
We will review the decentralized derivative exchanges in next posts.
My LinkedIn https://www.linkedin.com/in/paven-do/
My Twitter https://twitter.com/pavendo86