CFMM automatic market maker project comparison, DEX finds the right way to open
Do not go gentle into that good night
first level title
Pain points of traditional market makers in Defi
In the workflow of traditional exchanges, market makers need to create orders based on the current market conditions, and the orders need to be listed on the chain. Due to the packaging efficiency of the current public chain (such as Ethereum), some orders may have to wait for a long time before being packaged, or wait forever, which greatly restricts the capital use efficiency of market makers. At the same time, the market is changing rapidly. Maybe the price just now has not been packaged, so the order needs to be canceled and placed again. So protocols like 0x use off-chain matching to solve this problem.
The second is transaction fees. Traditional market makers are very sensitive to fees. High fees not only affect the choice of strategies, but also affect the arbitrage space, so they may give up directly because they cannot make money.
first level title
What are CFMMs?
First of all, Automated Market Maker (Automated Market Maker) is not the first on the blockchain. The concept of AMM has been studied in academia for 10 years. The research mainly focuses on the design of information aggregation and how to apply it to certain markets. , in these markets returns depend on some future state of the world, such as prediction markets.
The most popular AMM is the Logarithmic Market Scoring Rule (LMSR), which was proposed in 2002 and is used in most prediction markets (such as Augur V1 and Gnosis). There are other strategies for AMM information aggregation, such as Bayesian market makers (which do well in binary markets) and dynamic pari-mutuel market makers (often used in horse racing).
But in the field of blockchain, AMMs are endowed with new application scenarios, and this type of AMMs can be called "constant function market makers", that is, CFMMs.
CFMMs are the first AMMs dedicated to real financial markets. The encryption community designed CFMM, using CFMM to allow users to automatically exchange digital assets to build a decentralized digital asset exchange, which is based on a function that is based on the available quantity of two or more assets. Create a pre-defined price combination. Unlike traditional order book-based exchanges, traders trade with a pool of assets rather than with a specific counterparty. CFMM does not require the intervention of a centralized institution. It collects the user's assets into a fund pool. According to the asset allocation of the fund pool, it uses a certain algorithm in the smart contract to automatically quote and complete the user's buy and sell orders, thereby achieving the purpose of asset exchange.
first level title
Advantages of CFMMs
good experience
The pain points of traditional market makers have been mentioned above. With the CFMM model, as long as the liquidity pool gathers enough assets, the contract will automatically give the current quotation according to the asset allocation of the current fund pool, and the user can immediately trade (of course, the slippage problem will be discussed later), and its speed and experience are quite good.
Easier access to liquidity
Channeling liquidity is a particularly laborious and costly process on order book-based exchanges. Typically, exchanges need to find market makers, have them write custom code for pricing and posting orders, and often provide accounts and funds directly to facilitate transactions. Because CFMMs encourage passive market participants to lend their assets to pools, they make the provision of liquidity order-of-magnitude easier.
user participation
Traditional exchanges have higher capital requirements for market makers, or provide high-value allocations. Otherwise, facing large orders, it is easy to run short of funds, resulting in liquidity drying up, resulting in large price fluctuations.
price discovery
price discovery
CFMMs solve the so-called "oracle problem" by providing the ability to measure the price of an asset without using a centralized third party. Therefore, a decentralized exchange using the AMM mechanism has a good price discovery capability, and other smart contracts can use it as a source of real information.
first level title
Current CFMM projects
first level title
Dimensions of CFMM project comparison
Before project comparison, we need to talk about what it needs to care about for different CFMMs, as well as the emergence of new CFMM projects, and what are the innovations
core formula
Protection against external price volatility and loss resistance
Liquidity Provider (LP) Earnings
exchange asset type
Slippage Protection Mechanism
secondary title
Uniswap
Uniswap can be said to be very popular. It was only an experimental product at the beginning, but it has become a star-level project. The constant product market maker strategy implemented by Uniswap satisfies the following equation:
R(α) and R(β) are the reserves of a certain asset, and γ is the transaction fee. When trading any amount of a certain asset, when changing its reserve, it must be guaranteed that: when the transaction fee is 0, the product R(α)R(β) must always be equal to the constant k. This is often simplified as xy=k, where x and y are the reserves of the two assets. In practice, since Uniswap charges a 0.3% transaction fee and puts it into reserves, k will grow per transaction.
Converted to a graph, that is, a curve:
The advantage of Uniswap is very simple, but the disadvantage is obvious, that is, the slippage is large
When the amount purchased in Uniswap is greater than 2% of the liquidity pool, it is particularly expensive to purchase the asset.
Uniswap has set up a 0.5% slippage protection for this. When your one-time purchase exceeds 0.5% of the liquidity pool, it will be triggered and the transaction will not be successful. Slippage protection not only protects traders but also protects liquidity providers, preventing excessive impermanent losses
Impermanent loss: This is because after LP invests in assets, when there is no fee income, in the face of market fluctuations and exchange rate changes, arbitrageurs will continue to take assets, resulting in the total value of the assets in the pool they own than when they first invested. It has become less, but when the exchange rate returns to the exchange rate at the time of investment, this part of the loss disappears again.
Uniswap currently only supports the exchange between two assets, but it can open a reserve pool between any ERC20 transaction pairs, thus forming a certain long-tail effect. This is a really cool feature.
secondary title
Curve.fi
Curve.fi is more focused on the swap between stablecoins. So it is more like a Uniswap customized for stable currency transactions. But in the near future, it will be found that Curve has listed renBTC and wBTC. It seems that it is not satisfied with the stable currency trading market at present. However, the value of the two assets is anchored at 1:1. In the future, we will expand the exchange of stable exchange rate assets.
Curve.fi's innovation is mainly in low slippage, which optimizes the problem of large slippage loss caused by large transactions
The exchange rate formula used by Curve is as follows:
Compared with Uniswap, it can bite closer to a straight line, so that it can guarantee lower slippage in a larger range, and at the same time maintain unlimited liquidity at both ends.
In tests, Curve’s slippage was comparable to that of centralized exchanges. Taking the trading pair DAI/USDC between stablecoins in Coinbase as an example, when an order of $100,000 is pushed into the trading system, Curve is slightly better than Coinbase, and Coinbase's handling fee is $460 more than Curve.
Compared with Uniswap, Curve charges a lower handling fee of 0.04%, which means that it is more attractive to trading users. Although it will cause a decrease in the single income of liquidity providers, if there are more trading users, then the actual income It will also be higher.
In addition to Curve's own transaction fees, it also combines other DeFi products to launch more combined returns. After Curve combined another new DeFi protocol iearn, the highest annualized return was 30%. Its core is to find other lending platforms to obtain stable coins to obtain additional income from the lending platform.
In terms of products, Curve adopts a more retro geek style, similar to the early DOS system interface. Of course, this may be popular with technical geeks, but it may cause public aesthetic differences.
secondary title
MOV
Recently, the superconducting protocol created by the Bytom team is also the first CFMM project not on the Ethereum chain, and it is also a stable currency exchange project. Let’s start to explore its advantages.
MOV intends to build a more flexible CFMM function and key parameters suitable for the exchange market between stable coins. MOV expands the two-dimensional function model to a multi-dimensional geometric space that can be flexibly adjusted, that is, it supports the mutual exchange between multiple currencies in a reserve pool. Exchange, and solve the problem of depositing a single asset. MOV still takes low slippage as its advantage, and at the same time provides comprehensive risk control guidance, especially the risk of external market fluctuations, including LP's impermanent loss (Impermanent Loss), slippage protection mechanism, arbitrage issues, etc.
The core formula of MOV:
The graphic display is as follows (blue represents the constant product surface, green represents the constant sum surface, and the middle is the shape of the core formula in three-dimensional space)
Here it is specifically pointed out that the so-called multi-dimensional is only the core expression that can be compatible with multiple variables, that is, multiple currencies, but only two exchanges exist in the same time and space, and there is no exchange of three or more, otherwise it will be Upscale to a real multi-dimensional space. In the actual transaction scenario, most exchanges are in pairs.
In terms of slippage, according to the experimental data of the R&D team, under the level of liquidity of 500,000, the slippage of a one-time large transaction of 200,000 US dollars is 0.29% (thousands), compared to several major centralized exchanges. Have sufficient competitiveness.
In addition, MOV also sets slippage protection gears within the range of 5% to 10%, giving sufficient slippage protection for one-time large-value transactions, and avoiding excessive losses to traders. Another protection is that if the exchange rate is found to be different from that submitted by the user when uploading the chain, a deviation of 0.01% can be allowed, and if it exceeds, the asset will be returned.
MOV also implements slippage protection for LP (liquidity provider). The slippage protection mechanism will detect that the range of LP is exceeded, and allow LP to continue to deposit within a small range, otherwise the operation will be rolled back. In the case of extreme arbitrage, the official arbitrageurs accept the excessive arbitrage space in time, and then return the profits to LP.
In addition, MOV announced an annualized interest calculation model, which Curve does not have:
(1) If there is no change in the size of the liquidity, no matter how the ratio of the two coins in the liquidity pool changes, the percentage of A remains unchanged, and it is still the number of ctokens held by itself divided by the current total number of issued ctokens;
(2) When the liquidity size changes (add liquidity/withdraw liquidity/fee from swap), calculate the new D value D1, and then the total number of ctoken issued at this time is the previous D1/D0 times, if A withdraws at this time Own assets, the percentage is the ctoken held by A divided by the total number of ctokens issued at this time (important note: whether it is new LP investment assets or transaction fees backfilling the liquidity pool, we abstract it as a change in liquidity, which means It is the only factor that affects the share calculation, but only when a new LP joins the asset, the total ctoken issuance is calculated globally, including the number of newly issued ctokens given to the LP. From the time of the last LP joining to this moment, all The backfill of the handling fee is also included in the calculation process of the new total ctoken quantity).
In terms of products, MOV is mainly based on mobile terminals, and its superconducting-related functions are divided into two sections: financial management and exchange
It is very clear that two currencies can be invested and the current interest rate situation can be obtained
The exchange is similar to one-click exchange, as long as there is enough amount in the liquidity pool, the exchange can be performed quickly.
secondary title
Balancer
Balancer is simply understood as a generalized version of Uniswap. Balancer increases the number of tokens in the pool from 2 to multiple (currently Balancer can be set up to 8), and changes the proportion of each 50% to a completely customized ratio, that is, in a certain pool, It is no longer limited to the corresponding tokens that must be injected with a 50% value ratio, but tokens with a user-defined ratio of value, such as 75% MKR and 25% ETH.
Balancer uses a constant average market maker, which is a generalization of a constant product market maker. It can be used in the case of more than two assets, and the weight is not limited to 50/50. The core formula is as follows:
The graphics are as follows:
Compared with Uniswap, Balancer has several advantages:
Multi-asset support: Balancer supports up to 8 assets
Rate customization: users can customize the handling fee instead of 0.3% like Uniswap
More imaginative: index fund generators can be constructed, for example: track the situation of the cryptocurrency market, which can be composed of Bitcoin (which can be realized by using WBTC or HBTC cross-chain to Ethereum), Ethereum and DAI; track the DeFi ecology, It can be composed of native tokens of DeFi protocols, such as MKR, ZRX, KNC, BNT, etc.;
Of course, Balancer also has flaws, because the inflow of multiple assets and different ratios will cause asset imbalances at certain critical points, resulting in greater slippage.
first level title
Comparison of several projects
write at the end

write at the end
We all know that in the blockchain industry, whether it is technology, model or application, the update iteration is very fast, and many projects that were born with stars and moons are just short-lived in the end. So will CFMM also have such a situation?
According to Andrew Bakst's point of view, automated market makers enable frictionless transactions between assets on a certain blockchain. The combination of blockchain and automated market makers will make the assets used by the payer for payment no longer necessarily The same asset that the lender is willing to accept. That is to say, any asset can be used as a medium of exchange, and legal currency is no longer needed as a medium.
The first step of the blockchain is to put assets (such as bonds, securities, real estate, central bank digital currency) on the chain, but there are still certain problems in the pricing and trading of assets. Then through an automated market maker to solve this problem, A can use digital euros and Amazon stocks, while B can receive digital dollars and Apple stocks. As long as there are corresponding automated market makers to undertake the corresponding business: any asset can become a trading medium. (Article reference:https://medium.com/)
From here, we can see the huge potential of CFMM. Now the related ecology on Ethereum is also booming, and more and more assets are locked. Although some security incidents have hit the confidence of some participants, the road is tortuous. I believe its future must be bright.


