IOSG In-depth Research: Potential Risk Loss of AMM Protocol in the Post-liquidity Mining Era

星球君的朋友们
本文约6488字,阅读全文需要约26分钟
This article takes you to understand the loss risk and hedging strategy of the liquidity mining AMM protocol.

Editor's Note: This article comes fromIOSG(ID: IOSGVC), reprinted by Odaily with authorization.

Building a new world, the bridge of the time.

, reprinted by Odaily with authorization.

introduction

introduction

In this article, we will mainly study the liquidity provider (LP) in the AMM protocol, especially in the post-liquidity mining era, as a potential loss that an LP may face. Most of the TVL of Uniswap v2 (approximately 2.3 billion US dollars) is concentrated in four fund pools built for liquidity mining, and these pools account for a large proportion of the entire platform. At present, Uniswap's LPs don't care much about losses, because they are compensated with valuable tokens and transaction fees that cannot be underestimated. But as mining stops, the potential loss as an LP will become more of a concern.

secondary title

The choice in the post-liquidity mining era - AMM?

Liquidity mining has been proven to be an effective incentive mechanism for cold start protocols. Recently, we have noticed one of the craziest liquidity mining events in the not-so-long history of DeFi: Uniswap has successfully forked in several ( Such as Sushiswap), launched its own governance token. Every address that has ever invoked a Uniswap v1 or v2 contract is eligible for 400 UNI tokens, including over 12,000 addresses that have submitted failed transfers.

In addition, Uniswap’s liquidity mining has stopped on November 17, and UNI tokens are distributed to four pools: USDC/ETH, ETH/USDT, DAI/ETH, and WBTC/ETH. The community gave an extremely enthusiastic response, and the TVL (Total Value Locked) was pushed to 3 billion US dollars!

The hype based on UNI token mining, coupled with the impression that Uniswap is considered by the public to be the backbone of the DeFi ecosystem, has attracted billions of dollars in capital from investors. With the assistance of a huge amount of funds, Uniswap provides the most competitive prices in large transactions. For example, if you sell 1,000 ETH, Uniswap will be one of the exchanges offering the best price.

On the other hand, new automated market maker (AMM) solutions are pushing the field even further. It is worth mentioning that on Uniswap, the ETH/USDC liquidity exceeds 560 million US dollars. However, for the same trading portfolio, DODO, which has about $8.6 million in liquidity, can provide prices as competitive as Uniswap. For example, if you exchange 1000 ETH for USDT, COFIX will provide a price similar to Uniswap, although the liquidity is several times smaller than Uniswap.

As can be seen above, the new AMM model is more capital efficient than Uniswap v2. For Uniswap v2 to remain competitive, it must maintain higher capitalization relative to competitors. However, once liquidity mining stops, can Uniswap v2 continue to maintain the status quo? Will the community make choices in the future?

 Uniswap v2、DODO、COFIX 


text

secondary title

Framework for defining impermanent losses for AMM liquidity providers

What kind of losses did Uniswap's LP suffer? A widely used term to describe this type of loss is: impermanent loss. It's "impermanent" because it will theoretically disappear (which doesn't happen very often) in case the relative price between the offered tokens recovers. The impermanent loss usually refers to the value lost by providing liquidity - the difference between the hypothetical users holding tokens outside the pool and the actual value of staking those tokens into the pool.

In more detail, price discovery tends to happen in external markets, while Uniswap relies on arbitrage to converge AMM prices with market prices. However, the arbitrage profit is at the expense of the liquidity provider, and unless the external price of a particular asset pair returns to the same ratio as when the LP entered the pool, he will not be able to recover from this loss.

example 1

What would happen if XYT market price surged to 110 USDC?

The pool will provide an arbitrage opportunity as traders can withdraw undervalued XYT from the pool until the price converges with the market price. Specifically, traders will withdraw approximately 0.47 XYT from the pool, bringing the price of each XYT token to 110 USDC. Note that the amount required to move the price to a certain level is determined by the formula (curve) used by the pool. The new balance in the pool is approximately 1048.81 USDC and 9.53 XYT tokens, a total value of approximately $2,097 considering the new price XYT=110 USDC. On the other hand, an individual investor holding 10 XYT and 1,000 USDC in his/her wallet would have a portfolio value equal to $2,100, which means a loss of about $3 in impermanence.

image description

XYT/USDC-Assumption pool

Introduction to impermanent loss:

Ø Definition: the difference between passively holding tokens and providing liquidity to the pool

Ø Reason: arbitrage to adjust the currency price of the fund pool

DODO and COFIX represent a new type of AMM, which does not rely on arbitrage to adjust the asset ratio in the asset pool, but directly obtains the price from the oracle. For consistency, let's see what happens if we put the above example in DODO/COFIX.

Example 2

Suppose an XYT/USDC pair has an initial balance of 10 XYT and 1,000 USDC (price 1 XYT=100 USDC). Meanwhile, assume an individual investor holds a wallet with 10 XYT and 1,000 USDC.

The fund pool will not provide arbitrage opportunities, because the oracle will adjust the price, and the balance of payments of LP will not change due to external price changes. Token holders are indifferent in their preference between providing liquidity to the pool and simply holding tokens in wallets (ignoring transaction fees).

Therefore, the new AMM model is not prone to impermanent loss, but this does not mean that we provide liquidity for the new AMM model without loss.

secondary title

Loss characteristics of the new AMM model - COFIX example

Example 3

To illustrate, assume another example of XYT token value 100 USDC. Since COFIX does not rely on the ratio of tokens in the pool to determine the price, let us further assume that the token balance is equal to 10 XYT and 500 USDC, and assume a pool value of $1,500.

15 XYT*110 USDC+500 USDC=2,If Alice deposits an extra 5 XYT, the pool value will jump to $2,000 and she will receive 25% ownership. Since Alice is the owner of the fund pool, due to the particularity of the COFIX mechanism, she needs to bear the risks related to the two tokens in the pool.

Assuming again that the price of XYT token rises to 110 USDC, the pool value will become:

0.25*2,$150

Alice owns 25% of the pool and now owns:

$150 = $537.5

However, if she has a single token exposure, she can exit the pool with $550. On the other hand, if the XYT token price plummets, she will have some protection because she is exposed to a mixed pool between XYT and USDC, not just the XYT token.

Example 4

In addition, a feature of the COFIX mechanism is that there is no bonding curve, and large transactions will not be penalized. Therefore, extreme cases can occur where traders completely exhaust the supply of XYT before the price increases. Assume again that the initial price is XYT=100USDC, and Bob, a specific trader who wants to gain exposure to XYT token. Bob can buy all XYT tokens with $1,500, leaving the pool for 0XYT and 2,000 USDC. Afterwards, if the price of XYT jumps to 110 USDC, Alice will have zero exposure to this rise.

COFIX Risk Summary:

Ø However, the risk exposure of providing liquidity on COFIX is in the fund pool, not a single token.

Ø Similarly, a pool of funds can be completely drained from a rise in one of the tokens, since COFIX does not distinguish between large transactions (ie no bonding curve).

secondary title

Loss characteristics of the new AMM model - DODO example

DODO LP does not need to worry about the above risks, because DODO allows individual token exposure, not pool ownership.

However, it is important to note that due to the volume and frequency of transaction activity, the number of tokens at any point in time may differ from the number of tokens initially deposited into the pool.

WBTC/USDC pool, LP ownership

source:https://DODO-pool-tracker.vercel.app/

image description

YFI/USDC pool, LP ownership

source:https://DODO-pool-tracker.vercel.app/

image description

source:

The main reason for these losses is the inability of DODOs to rebalance the short-supplied portion of the pool in a timely manner. In order for DODO's mechanics to work as intended, a quick response to the incentives provided by DODO (i.e. fast rebalancing) is critical, especially for tokens with wild price swings. Because the longer the token is out of balance, the greater the chance of a major change in the market price. As shown below, changes in market prices during these periods can damage LP value.

Example 5

Assume again that there are 10 XYT and 500 USDC in the fund pool, and the value of 1 XYT is 100 USDC. If the current balance of the XYT token drops to 9 XYT, DODO aims to rebalance the supply of XYT to 10 by raising the price of XYT above the market price to encourage traders to sell the XYT token Back to the pool.

However, if XYT appreciates to $110 before rebalancing, it will be impossible to increase the initial supply of XYT to $10 without extracting value from USDC LP.


1. Initial balance: 10 XYT&500 USDC

2. Balance after the first transaction: 9 XYT&600 USDC

The price of XYT jumped to $110 before rebalancing. At this time, DODO does not have enough resources to rebalance the XYT side of the pool, so it is only possible to increase the total amount of XYT to 10 by sacrificing the usdc side of the pool.

3. Assuming that a trader carrying 1 XYT to the pool will result in a new balance of 10 XYT & 488 USDC; in this case, USDC LP will cumulatively lose ~12 USDC. (simplified calculation)

What usually happens is that the rebalancing happens before the price appreciation. This will bring both sides of the pool close to the initial balance of 10 XYT and 500 USDC. On the other hand, before rebalancing, the XYT price drop will bring profit to the LP in the above scenario, because DODO will be able to restore the pool on the XYT side with less than 100 USDC spent, resulting in 10 XYT and >500 USDC balance.

When a token in the pool is under-supplied, DODO's position is essentially a short position in that token, as it incurs losses as the price rises and gains as the price depreciates.

Example 6

In addition, XYT LP may suffer losses under the following circumstances:

1. Initial balance: 10 XYT&500 USDC

2. Balance after the first transaction: 11 XYT&400 USDC

As mentioned earlier, having an undersupplied USDC side in a pool is similar to having a short position in USDC. Therefore, a drop in the price of XYT to 90 USDC would mean a relatively stronger USDC and a loss pool at the same time.

XYT=90 USD, DODO does not have enough resources to rebalance the USDC side of the pool, therefore, only by sacrificing the XYT side of the pool, it is possible to bring the total amount of USDC to 500.

3. Suppose the trader brings 100USDC to the pool, a new balance will be generated. : ~9.86 XYT and 500 USDC, LP loss is ~0.14 XYT (simplified calculation)

In the same way, before rebalancing, the price increase of XYT will bring profits to LP in the above situation, because it means the relative weakness of USDC.

As shown in the examples above, effective rebalancing is critical to protecting the value of LPs and minimizing risk. Otherwise, DODO itself has a short position on one side of the pool and may generate profit/loss based on market fluctuations. In contrast, DODO is market neutral when the pool is in balance.

Back to the YFI/USDC pool, the reason for the loss is the inability to maintain a market-neutral position, so the risk exposure to the large fluctuations of the YFI token is too large.

Another potential reason for the loss of the YFI/USDC pair is the vulnerability to the vulnerability of the oracle machine to trade ahead. Since DODO relies on Chainlink price feeds, traders can observe that the oracle price of a particular token will rise in the next block and withdraw a large number of tokens from the pool, but sell them immediately after the update. This behavior will bring arbitrage to traders and losses to DODO LP.

Example 7

1. Initial balance: 10 XYT&500 USDC

The price of XYT will rise to $110 in the next block.

2. The trader trades ahead of the oracle and gets 1 XYT from the pool (for simplicity).

3. New balance: 9 XYT&600 USDC

Official price update

At this time, DODO does not have enough resources to rebalance the XYT side of the pool, so it is only possible to increase the total amount of XYT to 10 by sacrificing the USDC side of the pool.

4. Trader exits position ~$12 profit after updating lock, new balance: 10 XYT & ~488 USDC

USDC LP will lose ~12 USDC

Although the end result of Example 5 and Example 7 is the same, the latter is much more harmful to LP. The trader in Example 5 is likely to be classified as a random trade flow with no ability to predict market direction. Therefore, it is acceptable to be a counterparty to such traders. On the contrary, the trader in Example 7 is an information trader (arbitrageur), which will definitely cause losses to the liquidity provider. Both sides of the YFI/USDC pool are significantly lower than 1, which may mean that the reason is information traders (arbitrageurs), rather than random transaction flow.

Nonetheless, DODO does provide a single token exposure, and LPs must be aware of the characteristics of another token pool. . For example, theoretically, due to the single token exposure, if you are a USDC LP, you will not care whether the other tokens in the pool are WBTC or YFI. In practice, however, the difference is huge. The more volatile the other tokens in the pool, the greater the risk exposure.

DODO Risk Summary:

Ø DODO solves the impermanent loss feature of Uniswap, and it is not susceptible to the same loss as COFIX because it provides a single token exposure.

Ø However, when DODO cannot effectively rebalance the token supply, LP is indirectly exposed to the other side of the pool. In this case, DODO LP may make profits/suffer losses based on market price movements.

The aforementioned COFIX and DODO LP losses are inherently impermanent in that they may disappear, or even exist, if the price moves in favor of the market maker. However, instead of categorizing them as impermanent losses according to the definitions discussed earlier, we can define them as market-making risks specific to each protocol.

Below we summarize the risk characteristics of each of the above platforms.

secondary title

Risk hedging - the key point for the sustainable development of the AMM protocol

Market making is not a risk-free activity, whether using the order book model or the AMM protocol model. Regardless, LPs need to be mindful of potential losses in adverse circumstances. Without understanding the risks, LPs cannot accurately determine the expected rate of return on mining funds, nor can they properly hedge their positions.

**COFIX was the first company to offer hedging options for LPs:https://github.com/Computable-Finance/CoFiX-hedger

epilogue

secondary title

epilogue

Simple design and easy to understand are the key advantages of Uniswap, which has attracted a large number of LPs and capital. On the other hand, emerging AMM solutions inevitably become more complex as they attempt to increase capital efficiency. Nonetheless, in these AMM solutions, we believe that any market making activity carries potential losses. LPs must be mindful of these losses and analyze and hedge their risk according to their own risk appetite.