No matter how strange and complex a DeFi protocol or even the entire DeFi world looks, it is traditional financial logic (such as trading tool logic and lending tool logic), plus new logic applicable to or triggered by blockchain, plus a little new design to improve performance . When we look at and analyze DeFi/DeFi protocols with this framework, we will find that they are not complicated and there are not so many new things. This series of articles will try to sort out the new logic on the blockchain based on the traditional logic, and then introduce the new design based on the first two. Let's start with the fuse of the DeFi outbreak, DEX as a trading tool. 01 A transaction involves two participants, the buyer and the seller, neither of which can be missing; but the two may not be able to find each other, so there needs to be a public trading place, such as a vegetable market or an exchange, where everyone goes when they want to trade, and buyers and sellers can easily meet. The most important function of a trading venue is that when a person wants to buy, he can buy (at a price he can accept); when a person wants to sell, he can sell. This is related to the number of transactions participating in the venue. The more buy orders and sell orders, the easier it is to reach a deal. In addition to being provided by real traders, buy orders and sell orders can also be provided by market makers. They themselves do not have trading needs, but they will provide a lot of buy orders and sell orders, so that even if there is a lack of real buyers or sellers, traders can complete transactions through market makers. Why do market makers do this? To make money. There are two main sources of income. First, they provide the most valuable liquidity for the exchange. When the exchange collects fees from real buyers and sellers, it will give part of the fees to the market makers. Second, the transaction price is always changing. Market makers place low-price buy orders and high-price sell orders to earn the difference between the two. The above is the basic logic of trading tools, which is applicable to both CEX and DEX. Why DEX has been difficult to develop is because there are not enough traders and market makers on the chain, or the liquidity is not enough . It is like a vegetable market. Although it is clean and beautiful, no one trades here. The less people trade, the more difficult it is to attract people (including market makers) to trade. 02 So why did DEX become so famous this year? Because they found a new way to provide liquidity: AMM (Automated Market Maker) . After this method provides liquidity for DEX, DEX naturally starts to operate. The "old" logic is that the operation of the exchange depends on liquidity, and market makers play an important role in providing liquidity; the superimposed "new" logic is AMM, which is and only a new way of working for market makers on the chain. In AMM, how do market makers work? Let’s take a vegetable market with poor liquidity and the need for market makers as an example. A market based on an order book (CEX and some DEX) is like this: a person comes to the market to sell rice at 3 yuan per pound, but no one wants to buy it, so the market maker buys the rice; the next day, someone comes to the market to buy rice, sees the rice sold by the market maker at 4 yuan per pound, and buys it because he thinks the price is right. The market maker needs to provide two orders to match the needs of real traders, one for buying and one for selling. An AMM vegetable market (Uniswap, Curve and other DEX) is like this: there is a big platform with a pile of rice on the left side of the platform, a pile of money on the right side, and a robot in the middle; when someone comes to sell rice, he only needs to put the 5 kilograms of rice in his hand on the left, and the robot will tell him how much money he can take from the right; when someone comes to buy rice, he only needs to put 50 yuan on the right, and the robot will tell him how much rice he can take from the left. The job of the market maker becomes simple. He only needs to put his rice and money on the table in the agreed ratio. The key point here is the calculation of the transaction price. How does the system know the transaction price of each transaction? In fact, it is not difficult to calculate it through a function. Taking Uniswap as an example, the function it uses is x*y=k, where k is an agreed constant, x is the amount of rice, and y is the amount of money. Suppose k = 2500, the initial amount of rice is 50, and the amount of money is 50; the rice seller comes and puts down 5 kilograms of rice, then y = 2500 / (50 + 5) = 45.45 is calculated, that is, when there are 55 kilograms of rice on the table, the amount of money should be 45.45, which also means that the rice seller can take 4.55 kilograms of money from the right side of the table (50 - 45.45 = 4.55). What will happen if the rice seller sells 5 kilograms of rice? Calculate y = 2500/(55+5) = 41.67, then the rice seller can take 3.78 from the right side of the table (45.45-41.67=3.78). Why is it that when selling 5 catties of rice, the first time I sell it, I can get 4.55 yuan, but the second time I sell it, I can only get 3.78 yuan? This is a disadvantage of using functions to set prices: slippage. The more x is sold, the cheaper x is; the more x is bought, the more expensive x is. The existence of slippage introduces a new role to DEX - arbitrageurs. The rice seller sold 5 kg of rice at 3.78 for the second time. Following x * y = k, if you buy 5 kg of rice at this time, it only costs 3.78. This cheap price is not necessarily because rice is really cheap, but it is made cheap by a sell order in one direction in this trading pool. Arbitrageurs can be considered as market makers. They rebalance the trading pool and make the trading price more reasonable . Imagine if the market is full of rice sellers and there are no arbitrageurs, then the trading pool will be difficult to continue because the price of rice is too low. It is not difficult to find that in the order book model, market makers make money from both transaction fees and price differences; in AMM, market makers, or liquidity providers, only make money from transaction fees, while arbitrageurs make money from price differences. This is a big difference between order books and AMMs due to different principles. It should be noted that slippage is related to the size of the trading pool . For example, if there are 500 yuan of rice and 500 yuan of money on the table, then the money you can get from selling 5 kilograms of rice twice is 4.95 and 4.84 respectively, and the slippage is relatively small. This is why AMM-type DEX regards liquidity provision as extremely important. The larger a trading pool is, the lower its slippage is and the better the user experience is. 03 Slippage is also related to the pricing function chosen by the DEX . For example, we use x+y=k to price. For the same rice trading, k=100, the initial amount of rice is 50, and the amount of money is 50. The rice seller comes and puts down 5 catties of rice, and can take away 5 shares of money, because this makes k=100; he puts down another 5 catties of rice, and can take away another 5 shares of money, because this makes k=100. Under this function, there is no slippage at all; but there is a fatal flaw. If 1 yuan cannot buy 1 kilogram of rice outside this market (and this market always has 1 yuan for 1 kilogram of rice), another type of arbitrageur will come to the market to buy all the rice, leaving only 100 yuan in the trading pool. This is a big risk for the liquidity provider, because he originally had 50 rice and 50 money. If the price of rice rises to 2 money per pound, he will have 150 money, and now he only has 100 money. So although x+y =k can avoid slippage, the risk is too high to be used alone. It can only be used with other functions to reduce slippage, and it is more suitable for situations where the relative price fluctuations of x and y are small. That’s why Curve exists. It serves transactions between stablecoins, so it can design pricing functions for this specific trading scenario (small price fluctuations between x and y). It adds x+y =k to x*y=k to optimize the trading experience. This choice of different pricing functions is the “new design” between different protocols mentioned above. The risk brought by x+y=k is called impermanent loss. All AMMs will have the problem of impermanent loss , because as long as the price in the trading pool is inconsistent with the price in the outside world, there will be arbitrageurs to "level the price", and what the arbitrageurs earn is what the liquidity providers lose. Therefore, a new batch of DEXs have emerged, such as Bancor V2, which use oracles to introduce prices from the outside world, thereby reducing the risk of inconsistency between the trading pool and the outside world and reducing impermanent loss. Adding oracle pricing to function pricing is the "new design". Therefore, when you see new protocols/new applications emerging one after another, don’t be overwhelmed by nonsense and details, just look at its new pricing method. And looking at a pricing method is to see how it reduces slippage and impermanent loss through design (through the choice of function, through integration with oracles, etc.). Interestingly, there is a mutually exclusive relationship between slippage and impermanent loss . Reducing slippage pursues price stability, while reducing impermanent loss pursues price changes. Optimizing one side may result in the loss of the other side. The latest trend is to introduce oracles to break the relationship between slippage and impermanent loss, so that only impermanent loss is reduced, but oracles will bring their own problems. Therefore, when you look at a new design at this point, pay attention to its pros and cons, as well as its applicable scenarios determined by them. We do not need to master all the details of a pricing function/pricing method, but only need to know its basic working principles and its practical application effects. The actual application effects can be simply, quickly and comprehensively known through the curve chart. For example, if you want to understand the impermanent loss of Uniswap, you only need to look at the figure below. The blue curve shows how much the impermanent loss will be when the price changes. Take three points as examples: the intersection of the yellow line and the blue line is when the external price does not change, the impermanent loss is zero; the intersection of the green line and the blue line is when the price drops by 50% and rises by 100%, the impermanent loss is -5.7%. It is not difficult to find that the loss is related to the magnitude of the price change, but has nothing to do with the direction. In short, when you need to understand different or new trading protocols, just look for its pricing method principles and curve charts. Given that the proposers of the protocol will definitely emphasize and explain the characteristics of their own pricing methods, what we need to do is to look at how the curve chart performs in terms of slippage and impermanent loss after listening to them. 04 The real DeFi may be the size of a discipline, but the current DeFi is not complicated. Don’t be confused by bubbles, too many words, or the coat given to it by others. Most importantly: the best way to understand DeFi is to use it. Finally, a brief summary: 1. AMM is a lazy version of market makers, a low-threshold version of market makers. Market makers do not need professional knowledge or work, they just need to put money into the trading pool. This opens the door to invest idle funds in market making. 2. The core of the design of AMM-type DEX is the design of pricing methods. Although there are many different designs, their main purpose is to reduce slippage and impermanent loss . 3. If you have a sum of money, you can: become a market maker to make money; use strategies to make money by arbitrage within the trading pool; use strategies to make money by arbitrage between different trading pools. 4. Although AMM is in the limelight, don’t forget the order book model DEX, which has outstanding advantages, but currently lacks liquidity. The order book model seems to be inferior to AMM in composability, but I am not sure, and whether there is this difference between the two is more important. Risk warning : The content of this article is only the author’s personal opinion, does not represent the views or position of Zhikuang University, and does not constitute any investment opinion or recommendation. |
<<: Several issues with A card drivers
>>: Why is Filecoin mining complicated? Three reasons are indispensable
To maintain a stable life, you need a lot of reso...
Rage Review : British fintech company ThoughtMach...
Different people in life have completely differen...
Rich girls' facial features in choosing a spo...
Internet finance's self-positioning in the er...
Liquidity mining is the starting point of this De...
Some people have good luck and live a happy life ...
Some people have a "川"-shaped palm, whi...
In August this year, the Qtum open source communi...
In fact, people who are judged by their noses are...
What does the crescent on the nail mean? The scie...
When friends get together, although some people c...
In ancient times, people attached great importanc...
Bitcoin, whose price had remained stable over the...
Men are afraid of choosing the wrong career, and ...