LOADING STUFF...

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Beginner's Guide2years go (2022)更新 Dexnav
0

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Read the reasons for the rise of DeFi's automated market maker, its remaining limitations and future prospects in one article.

The severe limitations of Ether 1.0 let easy Uniswap stand out, butEther 2.0 and L2 off-chain systems will allow more complex markets to flourish.

For a more comprehensive understanding of Automated Market Makers, read《Chain News Featured Article 丨 Read DeFi's Hot Track "Automated Market Maker AMM

Imagine a friend from college contacts you and says, "Hey, I have a business idea. I want to develop a market-making robot. I'll be able to quote a price at any time, no matter who comes in for a quote, and my pricing algorithm will use x * y = k. That's pretty much it. Want to invest?"

You will hide away.

In fact, what your friend just described is Uniswap, perhaps the world's most original on-chain market maker operation. Inexplicably, its trading volume has exploded in the past few months and it has become the world's largest decentralized exchange (DEX) based on trading volume.

If you haven't been paying close attention to what's been happening with Decentralized Finance (DeFi) over the last year, you may be asking, what's going on?

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Uniswap v2 transaction amount, data source.Uniswap.info

(If you are already familiar with Uniswap and Automated Market Makers, or AMM, please skip the following section and read "The Cambrian Explosion of AMM" directly)..

For the uninitiated: Uniswap is an automated 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, it quotes both assets and the number of units it holds for each asset multiplied together will always equal a constant.

This sounds a bit tongue-in-cheek: if Uniswap owns some x tokens and some y tokens, it prices each transaction so that the final number of x's it owns, and the final number of y's it owns, are multiplied together to equal a constant k. This creates a constant product equation: x * y = k.

This way of pricing two assets may seem very odd and too dictatorial to you. Why would letting the product obtained by multiplying the inventory numbers of the two tokens remain fixed ensure the right offer?

Uniswap Example

Suppose we put 50 apples (a) and 50 bananas (b) in a pool of Uniswap, and anyone can exchange apples for bananas or bananas for apples. Assume that the exchange rate between apples and bananas in the primary market is exactly 1:1. Since there are 50 apples and 50 bananas in the Uniswap pool, a * b = 2500 according to the above equation for the product of constants. For any transaction, Uniswap needs to ensure that the number of apples and bananas in the pool is equal to 2500 when multiplied by the number of apples and bananas in the pool.

Well, suppose a customer enters our Uniswap pool to buy an apple. How many bananas should she pay for?

If she buys one apple, we have 49 apples left in the pool, and 49* b still needs to equal 2500. Thus the total number of bananas b equals 51.02. Since there were 50 bananas in the pool before, we still need 1.02 bananas (in this universe we allow for fragmented bananas), so this customer buying an apple would get an offer of 1.02 Bananas / Apples.

Note that this is very close to the original 1:1 price between the two! Because this is a small transaction, the slippage is small. But what if the order is large?

What are the popular AMM (Automated Market Makers) these days and do you know them all?

You can interpret the slope of each point of this curve as the marginal exchange rate

If she wants to buy 10 apples, Uniswap's offer will be 12.5 bananas, which means that the unit price of each of the 10 apples is 1.25 bananas/apple.

If she wants to execute a large transaction like 25 apples, i.e. to buy half the number of apples in stock, then the unit price goes up to 2 bananas / apple! (You can understand this intuitively, because one item in the pool is halved, the other one 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 be on thisback and forthon this price curve, no matter where demand takes it.

What are the popular AMM (Automated Market Makers) these days and do you know them all?Uniswap moves back and forth on the pricing curve after a series of trades

Here's the fun part: If the real trade 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 point and she buys 12.5 bananas, restoring the pool to its original state, she only has to pay 10 apples, so Uniswap charges her only 0.8 apples/banana.

Uniswap will sell bananas at a low price! It is as if our algorithm realizes at this point that there are too many bananas, so it sells them off at a low price to attract an inflow of apples and thus rebalance its inventory.

Uniswap often does this dance - deviating slightly from the real trading price and then easing back to normal with the help of arbitrageurs.

Introduction to Arbitrage Loss (Impermanent Loss)

Below you will learn how the Uniswap pricing mechanism works. But this still begs the question - does Uniswap do its job well? Does this thing really generate profits? After all, any market maker can quote a price, but it's hard to say whether it makes money or not.

The answer is: it depends! Specifically, it depends on a concept known as "Impermanent Loss". It works in the following way.

Uniswap charges a small fee for each transaction (currently 0.3%). This is in addition to the notional price. Therefore, if apples and bananas are always and forever traded at 1:1, these fees will accumulate over time as market makers move back and forth on the trading price curve. Then, the Uniswap pool will eventually accumulate more fruit compared to a baseline holding only 50 apples and 50 bananas.

But what would happen if the real trading price between apples and bananas suddenly changed?

Suppose a banana farm suffers a drone attack and there is a large shortage of bananas. Bananas are now as expensive as gold. The trade price soars to 5 apples for 1 banana.

What happens on Uniswap?

Arbitrageurs don't delay for a second and immediately kill your Uniswap pool to snap up the cheap bananas. They resize the trade so that they buy all the bananas whose price is below the new rate of 5:1. This means they need to move the price curve until the following equation is satisfied: 5x * x = 2500.What are the popular AMM (Automated Market Makers) these days and do you know them all?Doing the math, you get the following result: they bought a total of 27.64 bananas for 61.80 apples. The average transaction price is 2.2 apples to 1 banana, which is well below the market price and is equivalent to getting 76.4 free apples.

Where do they get their profits from? At the expense of the pool of money, of course! And, if you count you will see that the Uniswap pool is now down exactly 76.4 apples in value compared to someone who held the initial 50 apples and 50 bananas. uniswap sold the bananas too cheaply because it had no idea that bananas were becoming so valuable in the real world.

This phenomenon is called "arbitrage loss". Whenever the price of a trade changes, there will be arbitrageurs stealing cheap assets until the pool is priced correctly. (These losses are "temporary" because if the true trading price later reverts to 1:1, then it is as if you never lost the money, compared to the beginning.)

Money pools make money through transaction fees and lose money through arbitrage losses. This is all a function of demand and price divergence - demand favors the pools, while price divergence disadvantages them.

This is a brief overview of Uniswap. Of course you can go deeper, but the above knowledge is enough to understand what is going on in the field.

Since its launch in 2018, Uniswap has been sweeping the DeFi space. This is especially surprising considering that the original version of Uniswap was only about 300 lines of code! (AMM itself has a long pedigree, butConstant functions(Market makers are a relatively new invention.) Uniswap requires no license at all and anyone can inject assets. It doesn't even need a predictive machine.

A review will reveal that it is very elegant, one of the simplest products that could have been invented, it seems to have been born from a crack in the stone and dominated the DeFi field.

AMM's Cambrian explosion

Since the rise of Uniswap, there has been an explosion of innovation in AMM, with successors to Uniswap emerging, each with its own special features.

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Transactions of Uniswap, Balancer and Curve, source: Dune Analytics

Although they both 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 in a multi-dimensional plane. Some even use moving curves, which can deplete inventory, as is the case with Foundation's curve for selling limited-edition items.....

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Stableswap curve used in Curve (blue), source: Curve white paper . .

The different curves apply to specific assets, as they place different assumptions on the price relationship between the quoted assets. As you can see from the chart above, the Stableswap curve (blue) is close to a straight line in most cases, which means that the two stablecoins are priced very close to each other for most of their trading intervals. The constant product curve is a good starting point for any two stochastic assets, but if we know that the two assets are stablecoins and that they are likely to be roughly the same value, then the Stableswap curve will give a more competitive pricing.

Of course, an AMM can choose an infinite number of specific curves to price. We can abstract away from all these different pricing functions and call the whole class Constant Function Market Makers (CFMM) .

When seeing the growth of CFMM transactions, it is taken for granted that they will take over the world - in the future all on-chain liquidity will be provided by CFMM.

But change is not that fast!

CFMM dominates today. However, to get a clearer picture of the evolution of DeFi, we need to understand when CFMM is booming, and when it is underperforming.

Spectrum of correlation

Let's take Uniswap as an example, since it is the easiest CFMM to analyze. suppose you want to become a liquidity provider (LP) for the ETH / DAI pool on Uniswap . When funding that pool, you would have to believe both of the following to determine that being an LP is better than just holding the original assets.

  1. The value ratio of ETH to DAI will not change much (and if it does, it will show up as an arbitrage loss)
  2. This pool will receive a lot of transaction fees

In terms of the arbitrage losses exhibited by this pool, the transaction fees earned should exceed the losses. Note that for pairs containing stablecoins, how bullish you are on ETH going up, you are actually assuming there will be a lot of arbitrage losses!

The general principle is that the Uniswap theory works best when the two assets are mean reverting. Imagine having a pool of USDC/DAI or WBTC/TBTC assets - these pools should show a very small arbitrage loss that will purely accumulate transaction fees over time. Note that arbitrage losses are not just aVolatility issues (in fact, extremely volatile, mean-reverting pairs are great because they generate a lot of transaction fees).

Thus, we can plot the hierarchy of the most profitable Uniswap pools, keeping other conditions consistent.

What are the popular AMM (Automated Market Makers) these days and do you know them all?

The case of mean-reverting pairs is obvious. Trading pairs that are correlated tend to move their prices together, so Uniswap doesn't have much arbitrage to lose. With uncorrelated pairs like ETH/DAI, the situation is less certain, and sometimes transaction fees can compensate for losses. On the far right are the inverse correlated pairs, and this kind of pooling on Uniswap is bad.

Imagine someone is long Trump and long Biden in a prediction market and places both bets in a pool of money at Uniswap. The result of the pool is that some LP has nothing to gain, only arbitrage losses! (The market is always predicted to stop trading before it closes, but the results are often known long before the market actually closes.)

So, Uniswap works well for some pairs and is a disaster for others.

But it is easy to see that almost all of the head Uniswap pools have been profitable so far! In fact, even ETH / DAI pools have been profitable since their creation.

What are the popular AMM (Automated Market Makers) these days and do you know them all?

Return on ETH/DAI pool on Uniswap (vs. holding 50/50 ETH/DAI), source: ZumZoom Analytics

This phenomenon needs to be explained. Despite the flaws, each CFMM is a market maker that has made significant gains. How is this possible? To answer this question, it is necessary to understand the mechanism by which market makers work.

Introduction to Market Making Mechanism

The job of a market maker is to provide liquidity to a market. Market makers make money in three main ways: by designating market making arrangements (traditionally paid for by the asset issuer), by rebates on transaction fees (traditionally paid by the exchange), and by earning the spread from market making (which is what Uniswap does).

As you can see, all market making is a battle with two order streams: the informed order stream and the uninformed order stream. Suppose you are quoting for the BTC/USD market and a large BTC sell order arrives. You have to ask yourself: Is this someone trading for liquidity, or does this person know something that I am not aware of?

If the counterparty knows that the cache pool of the Ponzi scheme (PlusToken) has changed and the selling pressure is on, then you're stuck with some perfectly good USD for some not-so-good BTC. On the other hand, if it's just some nameless people selling coins because they need to pay the rent, then it doesn't make much sense and you just make the spread off them. .

As a market maker, you make money from uninformed trade flow. Uninformed trade flow is random - every day people sell and people buy, and eventually they cancel each other out. If you make a spread on each 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 uninformed retail orders).

Therefore, a market maker's first task is to distinguish between informed and uninformed order streams. The more likely it is that a stream is an uninformed stream, the higher the spread you should charge. If the order stream is definitely informed, then you should withdraw the quotation altogether, because if an informed counterparty is willing to trade with you, you are absolutely going to lose money.

(There is another way to think about this problem: the uninformed order flow is willing to pay more than the market price for an asset, and that's the spread you earn. The informed order flow is only willing to get an asset at a lower price than the market price, so whenever you trade with them, you are actually the one who loses out on the price. (These orders know something you don't know.)

The same principle applies to Uniswap. some people trade on Uniswap because they are completely randomly trying to trade ETH for DAI. For market makers, it's an uninformed stream of retail investors, and the random stroll of trading activity generates fee revenue. That's cool.

You are also dealing with arbitrageurs: they are informed order flow. They are selecting pools of money at the wrong price. In a way, they are actually helping Uniswap get the trade price back on track. But on the other hand, they are transferring the 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 cannot distinguish between these two streams!

Uniswap does not know whether an order comes from an ignorant retail investor or from some arbitrageur. It only follows the equation x * y = k, whatever the market conditions are.

So as soon as a new player offers better pricing than Uniswap, like Curve or Balancer, then you will see retail order flow migrate to the better priced service. Given Uniswap's pricing model and fixed rate (0.3% per transaction), you'd be hard pressed to see it competing in the most competitive pools - Curve is both optimized for stablecoin transactions and charges just 0.04% per transaction.

Over time, if the Uniswap pool is overtaken by rivals at the slippage point, the majority of what remains in Uniswap will be arbitrage order flow. Retail flows are variable, but arbitrage opportunities continue to arise as the market moves.

This loss of competitiveness in pricing is not only bad, but its downside is magnified; Uniswap has a network effect on liquidity during the upswing, but it is also severely magnified during the downside. As Curve starts to eat up the volume associated with stablecoins, DAI/USDC pairs on Uniswap will start to lose LPs, which in turn makes pricing worse and attracts less volume, further inhibiting LPs, in a vicious cycle.The network effect is the same - it's like a rocket on the way up, but burns up on the way down.

Of course, the same argument applies to Balancer and Curve, who will also struggle to maintain their fee income once they are overtaken by a better-priced, lower-fee market maker. Inevitably, the result is a downward competition in fees and a significant reduction in profit margins. (The same drama is playing out in the traditional market maker space! It's a super competitive business!)..

But that still doesn't explain it: why are all CFMMs growing like crazy?

Why is CFMM soaring?

CFMM is clearly capturing this vertical, taking stablecoins as an example.

Imagine that one of the heavyweight market makers in the traditional financial markets (like Jump Trading) is ready to start making markets in stable coins in the DeFi space. First they need a lot of integration work up front, and then, in order to continue operating, they need to pay traders ongoing fees, maintain trading software, and pay office rent. They need a lot of fixed and operational costs.

And Curve doesn't cost anything at all. Once a smart contract is deployed, it operates on its own (even the computational costs and gas fees are completely paid by the end user!)

If quoting for USDC/USDT pairs, Jump Trading would have to do something much more complicated than what Curve does. Stablecoin market making is pretty much about inventory management. There's not so much fancy machine learning (ML) or proprietary knowledge here, and if Curve can do 80% of what Jump can do, that's good enough.

But ETH/DAI is a much more complex market. When Uniswap quotes, it's not like Jump where you have to look at the exchange order book, model liquidity or refer to historical volatility, it's just close your eyes and shout x * y = k!

Compared to a normal market maker, Uniswap has the complexity of a refrigerator. But as long as normal market makers do not enter the DeFi space, Uniswap will have a monopoly on the market because it has zero start-up and operating costs.

Here's another way to think about it: Uniswap was the first small vendor to set up store in this new marketplace called DeFi. Even with all its flaws, Uniswap created a kind of virtual monopoly. When you have a monopoly, you get all the retail order flow. The ratio between retail and arbitrage flows is the main factor that determines how profitable Uniswap is, so no wonder Uniswap is making a lot of money!

However, this virtuous cycle is likely to end once retail flows start to go elsewhere.

But that's only half of the explanation. Remember: there were already a lot of decentralized exchanges (DEX) before Uniswap came along! What exactly made Uniswap defeat all the order book model exchanges?

From Order Book to AMM

I believe that there are four reasons why Uniswap beat the order book exchanges.

First, Uniswap is extremely simple to implement. This means low complexity, low surface area for hacking, and low integration costs. Not to mention, it has a very low gas cost! This is really important when you are executing all your transactions on what amounts to a decentralized graphical calculator.

This is not a trivial issue. Once a new generation of high-throughput blockchains becomes a reality, I doubt that the order book model will eventually still dominate, as it does in the regular financial world. But will it dominate on Ether 1.0?

The severe limitations of Ether 1.0 make simplicity stand out. When you can't do complex 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. The order book DEX must be run like aExchange.

Third, providing liquidity to Uniswap is easy. The one-click "set it and forget it" operation makes the LP experience incredibly easy (it's much more cumbersome for an active market maker to provide liquidity on a particular order book exchange), especially before DeFi's trading volume ramps up.

This is critical because a great deal of liquidity on Uniswap is provided by a small group of well-meaning giant whales. These whales are not as sensitive to returns on investment, so the one-click experience of Uniswap allows them to participate painlessly. Crypto project designers have a bad habit of ignoring psychological transaction costs and always assume that market participants are incredibly diligent. uniswap makes liquidity provision easy, and this pays off...

The final reason why Uniswap is so successful is that it is so easy to create incentivized pools. In an incentivized pool, the pool creator airdrops tokens to LPs, allowing the LPs to receive a higher return than the standard Uniswap return. This phenomenon is also known as "liquidity farming." Some of the largest pools in Uniswap are incentivized by airdrops, including AMPL, sETH, and JRT. for Balancer and Curve, all of their pools are currently incentivized with their own native tokens.

Recall that traditional market makers make money in three ways, one of which is a designated market maker agreement, paid by the issuer of the asset. In a sense, a pool of money with incentives is a designated market maker agreement in the DeFi space: the issuer of an asset pays an AMM to provide liquidity for their token pairs, and the fee is delivered via a token airdrop.

But there is another dimension to incentivized pools: CFMMs are not just acting as market makers, they now serve as both marketing and distribution tools for token projects. Through incentivized pools, CFMMs create a witch-proof way to distribute tokens to speculators who want to accumulate them, while directing a liquid initial market. It also puts the tokens in the hands of purchasers to other uses - not just to turn around and sell them, but to save them and get some profit! You could call it a beggarly version of pledging. It's a powerful marketing weapon for early-stage token projects, and I expect this to be integrated into the action manual for token listings.

These factors explain in depth why Uniswap has been so successful (I haven't talked about Initial DeFi Offerings yet, that's a topic for another day).

That said, I'm not convinced that Uniswap's success will last forever. If the limitations of Ether 1.0 set the stage for CFMM to become dominant, Ether 2.0 and the L2 off-chain system will allow more complex markets to flourish. In addition, DeFi's star projects are emerging and will attract serious traditional market makers as large numbers of users and transaction volumes arrive. Over time, I expect this will lead to Uniswap'sMarket shareShrinkage.

In five years, what role will CFMM play in DeFi?

I expect that by 2025, CFMM as it looks today will not be the primary way people transact. Such transitions are common in the history of technology..

In the early days of the Internet, portals like Yahoo! were the first companies to lead the way significantly online. The limitations of the early web environment (e.g. slow speed, etc.) lent themselves well to a directory of pages created by hand. As mainstream users began to come online, these portals achieved insane growth! But we now know that portals were only temporary stepping stones on the road to organizing information on the Internet.

What are the popular AMM (Automated Market Makers) these days and do you know them all?

What are the popular AMM (Automated Market Makers) these days and do you know them all?

The original Yahoo website homepage and the original Google website homepage

What is CFMM a stepping stone to the future? Will something new replace it, or will CFMM evolve along with DeFi? I will try to answer this question in my next post.

© 版权声明

Related posts

No comments

No comments...