An article to understand the reasons for the rise of DeFi automatic market makers, remaining limitations and future prospects
Editor's Note: This article comes fromChain News ChainNews (ID: chainnewscom)Editor's Note: This article comes from
Chain News ChainNews (ID: chainnewscom)
Chain News ChainNews (ID: chainnewscom)
, Written by: Haseeb Qureshi, Managing Partner of Dragonfly Capital, Compiled by: Perry Wang, published with permission.
You will stay away.
In fact, what your friend just described is Uniswap. Uniswap is perhaps the most original on-chain market maker operation in the world. Inexplicably, its trading volume has exploded in the past few months, and it has become the world's largest decentralized exchange (DEX) by trading volume.
If you haven’t been paying close attention to what happened in decentralized finance (DeFi) last year, you might ask, what happened?
image description
Uniswap v2 transaction volume, data source: Uniswap.info
To spread the word for novices: Uniswap is an automatic market maker, or AMM. You can think of an AMM as a primitive, robotic market maker that provides quotes between two assets at any time based on a simple pricing algorithm. For Uniswap, which quotes these two assets, multiplying the number of units of each asset it holds will always equal a constant.
This sounds like a mouthful: if Uniswap owns some x tokens and owns some y tokens, it prices each transaction so that the final amount it owns x is multiplied by the final amount it owns y will be equal to a constant k. This forms a constant product equation: x * y = k.
This way of pricing two assets might seem weird and arbitrary to you. Keeping the product of multiplying the stocks of the two tokens constant, why is it possible to ensure the correct quotation?
secondary title
Uniswap example
Well, let's say a customer enters our Uniswap pool to buy an apple. How many bananas should she pay?
If she buys an apple, we're left with 49 apples in the pool, and 49*b still needs to equal 2500. The total number of bananas b is then equal to 51.02. Since there were 50 bananas in the pool earlier, we need 1.02 more bananas (we allow fragmented bananas in this universe), so the quote that this customer will get for buying an apple is: 1.02 bananas/apple.
Note that this is close to the original price of 1:1 between the two! Since this is only a small transaction, there is less slippage. But what if the order is large?
image description
If she wants to buy 10 apples, Uniswap's quotation will be 12.5 bananas, that is, the unit price of each of these 10 apples is 1.25 bananas/apple.
If she wants to execute a large transaction of 25 apples, that is, to buy half the number of apples in stock, then the unit price will rise to 2 bananas/apples! (You can understand this intuitively, because if one commodity in the pool is halved, the other has to be doubled)
It is important to understand that Uniswap cannot deviate from this pricing curve. If someone wants to buy some apples, and later someone wants to buy some bananas, Uniswap will move back and forth on this price curve, no matter where the demand takes it.
image description
Here's an interesting thing: if the real transaction price between apples and bananas is 1:1, when the first customer buys 10 apples, our Uniswap pool will become 40 apples and 62.5 bananas. If an arbitrageur enters at this time and buys 12.5 bananas to restore the fund pool to its original state, she only needs to pay 10 apples, so Uniswap only charges her 0.8 apples/bananas.
Uniswap will sell bananas at a low price! It's as if our algorithm realizes there are too many bananas at this point, so it sells them at a low price to attract an influx of apples, thereby rebalancing the inventory.
Uniswap often does this kind of dance - slightly deviates from the real transaction price, and then slowly returns to normal with the help of arbitrageurs.
secondary title
Introduction to Impermanent Loss
Below you will learn how the Uniswap pricing mechanism works. But this still begs the question - is Uniswap doing its job well? Will this thing actually generate profits? After all, any market maker can quote, but it's hard to say whether it will make money.
The answer is: it depends! Specifically, this depends on a concept known as "arbitrage loss" (Impermanent Loss). It works like this:
Uniswap charges a small fee (currently 0.3%) on each trade. This is in addition to the nominal price. So if apples and bananas are always and always traded 1:1, these fees will accrue over time as market makers move back and forth on the traded price curve. Then, the Uniswap pool will end up accumulating more fruit than the baseline of holding only 50 apples and 50 bananas.
But what would happen if there was a sudden change in the real transaction price between apples and bananas?
Suppose a banana farm is attacked by drones and there is a widespread shortage of bananas. Bananas are like gold right now. The transaction price jumped to 5 apples for 1 banana.
What will happen on Uniswap?
Arbitrageurs will not delay for a second, immediately enter your Uniswap pool and snap up cheap bananas. They adjust the trade size so that they buy all the bananas that are 5:1 below the new exchange rate. This means they need to move the price curve until the following equation is satisfied: 5x * x = 2500.
Doing the math, you get the following: In total they bought 27.64 bananas for 61.80 apples. The average transaction price is 2.2 apples: 1 banana, which is much lower than the market price and equivalent to getting 76.4 free apples.
Where does their profit come from? Of course, this is at the expense of the capital pool! And, if you do the count, the Uniswap pool is now down in value by exactly 76.4 apples compared to someone holding the original 50 apples and 50 bananas. Uniswap sells bananas too cheaply because it doesn't know how valuable bananas have become in the real world.
This phenomenon is called "arbitrage loss". Every time the transaction price changes, arbitrageurs emerge to steal cheap assets until the pool of funds is priced right. (These losses are "temporary" because if the real trade price later returns to 1:1, then it's as if you never lost the money, compared to the beginning.)
This is a simple summary of Uniswap. Of course, you can go deeper, but the above knowledge is enough to understand the situation in this field.
Since its launch in 2018, Uniswap has taken the DeFi field by storm. This feat is especially surprising considering that the original version of Uniswap was only about 300 lines of code! (AMMs themselves have a long pedigree, but constant function market makers are a relatively new invention.) Uniswap is completely permissionless, allowing anyone to inject assets. It doesn't even need an oracle.
secondary title
AMM's Cambrian Explosion
image description
Trading volume of Uniswap, Balancer and Curve, source: Dune Analytics
Although they all inherit the core design of Uniswap, each has its own special pricing function. For example, Curve uses a hybrid model of constant product and constant sum, and Balancer's multi-asset pricing function is defined with a multidimensional plane. Some even feature moving curves, which can deplete inventory, like the ones Foundation uses to sell limited-edition items.
image description
The Stableswap curve (blue) used in Curve, source: Curve white paper
Different curves apply to specific assets because they make different assumptions about the price relationships between the assets they quote. As you can see from the above figure, the Stableswap curve (blue) is close to a straight line in most cases, which means that in most of its trading range, the two stablecoins are priced very close to each other. A constant product curve is a good starting point for any two random assets, but if we know the two assets are stablecoins and they are likely to be worth roughly the same, then the Stableswap curve gives more competitive pricing.
When seeing the growth of CFMM transaction volume, people take it for granted that they will take over the world - all future on-chain liquidity will be provided by CFMM.
But not so fast!
CFMMs dominate today. Still, to gain a clearer picture of DeFi’s evolution, we need to understand when CFMMs thrive and when they don’t.
secondary title
Correlation Spectrum
Still take Uniswap as an example, because it is the easiest CFMM to analyze. Let's say you want to become a Liquidity Provider (LP) for an ETH/DAI pool on Uniswap. When funding the pool, you have to believe both of the following to decide that being an LP is much better than just holding the original assets:
The value ratio of ETH to DAI will not change much (if it changes, it will appear as arbitrage loss)
This pool receives a lot of transaction fees
In terms of arbitrage losses exhibited by this pool, the transaction fees earned should exceed the losses. Note how bullish you are on ETH going up for pairs that include stablecoins, you're also assuming a lot of arbitrage losses!
The general principle is: Uniswap theory works best when the two assets are mean-reverting. Imagine having a pool of USDC/DAI or WBTC/TBTC - these pools should show minimal arbitrage losses, accruing purely transaction fees over time. Note that arbitrage losses are not just a volatility issue (in fact, extremely volatile, mean-reverting trading pairs are great because they incur a lot of transaction fees)
Therefore, we can draw a hierarchy diagram of the most profitable Uniswap pool, keeping other conditions the same.
Imagine that someone is long Trump and long Biden in a certain prediction market, and puts the two bets into one Uniswap pool. By definition, there will eventually be one asset worth $1 and another asset worth $0. As a result of this pool of funds, an LP gains nothing but arbitrage losses! (Prediction markets always stop trading before the market clears, but the results are often revealed long before the market actually clears.)
So, Uniswap works well for some trading pairs and is a disaster for others.
image description
Returns of ETH/DAI pools on Uniswap (vs holding 50/50 ETH/DAI), source: ZumZoom Analytics
This phenomenon requires explanation. Despite their flaws, CFMMs are market makers who have achieved decent returns. How is this possible? To answer this question, it is necessary to understand the working mechanism of market makers.
secondary title
Introduction to Market Making Mechanism
The job of a market maker is to provide liquidity to a certain market. Market makers mainly make money in three ways: designated market-making arrangements (traditionally paid by asset issuers), transaction fee rebates (traditionally paid by exchanges), and earning spreads from market making (Uniswap is this way ).
You can see that all market making is a battle with two kinds of order flow: informed order flow and uninformed order flow. Suppose you are quoting the BTC/USD market and a large BTC sell order arrives. You have to ask yourself: Is this someone buying liquidity, or does this person know something I don't know?
If the counterparty knows that the buffer pool of the Ponzi scheme (PlusToken) has changed and selling pressure is coming, then you can only exchange some perfect USD for some BTC with less promising prospects. On the other hand, if it's just some unknown person selling coins because they need to pay rent, then it doesn't make much sense and you just make the difference from them.
As a market maker, you make money from uninformed trade flow. The flow of uninformed transactions is random — every day someone sells and someone buys, eventually canceling each other out. If you make a spread on every trade, you will make money in the long run. (This explains why market makers pay to get order flow from the Robinhood exchange, which is mostly unwitting retail orders).
Therefore, the first task of a market maker is to distinguish between informed and uninformed order flow. The more likely a flow is an uninformed flow, the higher the spread you should charge. If this order flow is absolutely informed, then you should withdraw the quotation completely, because if an informed trader is willing to trade with you, you will definitely lose money.
(There is another way of thinking about this problem: uninformed order flow is willing to pay a price higher than the market price for an asset, which is the price difference you earn. Informed order flow is only willing to acquire an asset at a lower price than the market price, so , whenever you trade with them, you actually lose out on price. These orders know something that you don't.)
The same principle applies to Uniswap. Some people are trading on Uniswap because they want to trade ETH for DAI completely randomly. For market makers, this is the flow of uninformed retail investors, and the trading activities of random walks will bring fee income. This is cool.
You also have arbitrageurs: they are informed order flow. They are picking the wrong pool of money. To some extent, they are actually helping Uniswap bring the transaction price back on track. But on the other hand, they are transferring LP's money into their own pockets.
For market makers to make money, they need to maximize the ratio of uninformed retail flows to arbitrage flows.
But Uniswap can't tell the difference between the two streams!
Uniswap does not know whether an order comes from an ignorant retail investor or an arbitrageur. No matter what the market conditions are, it just follows the equation x * y = k.
Therefore, as long as there is a new player offering better pricing than Uniswap, such as Curve or Balancer, then you will see retail order flow migrate to services with better pricing. Given Uniswap's pricing model and flat fee rate (0.3% per trade), you'd be hard-pressed to see it competing in the most competitive pool - Curve is both optimized for stablecoin trades and $1 per trade The fee is only 0.04%.
This loss of competitiveness in pricing is not only bad, it is magnified. Uniswap has a network effect on liquidity during the rising period of development, but it is also severely amplified during the downhill period. When Curve starts eating up stablecoin-related transaction volume, the DAI/USDC trading pair on Uniswap will start to lose LP, which in turn makes pricing worse, attracts less transaction volume, and further suppresses LP, a vicious circle . The same goes for network effects — like a rocket on the way up, but burnt down the way back down.
Of course, the same statement applies to Balancer and Curve. They also struggle to maintain their fee income once they are overtaken by a market maker with better pricing and lower fees. Inevitably, the result of all this is a kind of downward competition of costs and a substantial compression of profit margins. (It’s the same drama in the market maker space of traditional markets! It’s a super competitive business!)
But that still doesn't explain: why are all CFMMs growing like crazy?
secondary title
Why is CFMM soaring?
Take stablecoins as an example. CFMM is clearly capturing this vertical.
Imagine that a heavyweight market maker in the traditional financial market (such as Jump Trading) is going to start making stablecoins in the DeFi field. First, they need a lot of integration work up front, and then, in order to continue to operate, they need to continue to pay traders, maintain trading software, and pay office rent. They require substantial fixed and operating costs.
And Curve costs nothing at all. Once the smart contract is deployed, it operates on its own (even the calculation cost and gas fee are fully paid by the end user!)
If quoting for the USDC/USDT trading pair, what Jump Trading has to do will be much more complicated than what Curve does. Stablecoin market making is largely inventory management. There's not that much fancy machine learning (ML) or know-how here, and if Curve can do 80% of Jump's level, that's good enough.
But ETH/DAI is a much more complex market. When Uniswap quotes, it's not like Jump, looking at exchange order books, liquidity modeling or looking at historical volatility, it just closes its eyes and yells x * y = k!
Here’s another way of thinking about it: Uniswap is the first small business to set up shop in this new market called DeFi. Even with all its flaws, Uniswap has formed a virtual monopoly. When you have a monopoly, you get all the retail order flow. The ratio of retail flows to arbitrage flows is the main factor that determines Uniswap's profitability. No wonder Uniswap is making a lot of money!
But that virtuous cycle is likely to come to an end once retail flows start looking elsewhere. LPs will start taking losses and withdrawing liquidity.
But that's only half the story. Remember: there were tons of decentralized exchanges (DEX) before Uniswap! Uniswap destroyed order book based DEXs like Idex or 0x. What factors made Uniswap beat all order book exchanges?
secondary title
From order book to AMM
I believe there are four reasons why Uniswap beats order book exchanges.
First, the implementation of Uniswap is extremely simple. This means low complexity, low surface area for hacking, and low integration costs. Not to mention, it has very low gas cost! This really matters when you're doing all your trading on what amounts to a decentralized graphing calculator.
This is not a small problem. Once a new generation of high-throughput blockchains becomes a reality, I doubt whether the order book model will ultimately be as dominant as it has been in the regular financial world. But will it dominate Ethereum 1.0?
The severe limitations of Ethereum 1.0 let simplicity stand out. When you can't do complicated things, you have to do the best simple things. Uniswap is a pretty good simple product.
Second, Uniswap has a very small regulatory surface (which is why Bram Cohen, the inventor of the file-sharing program Bittorrent, thinks Bittorrent will succeed). Uniswap is very decentralized and does not require off-chain input. Unlike an order book DEX, which has to follow suit like running an exchange, Uniswap is free to innovate as a purely financial application.
Third, it is very easy to provide liquidity to Uniswap. One-click "set it and forget it" operation makes the LP experience extremely easy (active market maker providing liquidity on an order book exchange is much more troublesome), especially before the scale of DeFi trading volume .
This is crucial because a lot of liquidity on Uniswap is provided by a small group of well-meaning whales. These whales are not as sensitive to return on investment, so Uniswap's one-click experience makes it painless for them to participate. Crypto project designers have a bad habit of ignoring psychological transaction costs and always assume that market participants are extremely hardworking. Uniswap made liquidity provisioning easy, and it paid off.
The final reason Uniswap has been so successful is how easy it is to create incentivized pools. In an incentivized fund pool, the creator of the fund pool airdrops tokens to LPs, so that LPs get higher returns than Uniswap standard returns. This phenomenon is also known as "liquidity farming". Some of the largest pools in Uniswap are incentivized via airdrops, including AMPL, sETH, and JRT. For Balancer and Curve, all their pools are currently incentivized with their own native tokens.
However, there is another dimension to incentivized pools. Rather than just acting as market makers, CFMMs now have the dual capacity of marketing and distribution tools for token projects. Through incentivized pools, CFMM creates a sybil-proof way to distribute tokens to speculators who want to accumulate tokens, while at the same time leading to a liquid initial market. It also allows the tokens in the buyer's hands to be used in other ways-not just reselling them, but saving them for some income! You can call it a beggar's version of pledge. This is a powerful marketing weapon for early stage token projects, and I expect this to be integrated into the playbook for token listings.
These factors explain in depth why Uniswap is so successful (I haven't talked about Initial DeFi Offerings, which is a topic for another day).
Having said that, I don't believe Uniswap's success will last forever. If the limitations of Ethereum 1.0 created the conditions for CFMM to form a dominant position, then Ethereum 2.0 and L2 off-chain systems will allow more complex markets to flourish. In addition, DeFi star projects are constantly emerging, and with the arrival of a large number of users and transaction volume, they will attract serious traditional market makers. Over time, I expect this to shrink Uniswap's market share.
What role will CFMM play in DeFi five years from now?
I don't expect that by 2025, what CFMM looks like today will not be the main way people trade. Such transitions are common in the history of technology.
In the early days of the internet, portals like Yahoo were the first businesses to take a big lead online. The limitations of the early network environment (such as slow speed, etc.), are very suitable for manual-made page directories. These portals grew like crazy as mainstream users started coming online! But we now know that portals were only temporary stepping stones on the road to organizing information on the Internet.
image description







