Loss versus Rebalancing 101

lang
en
url
category
Application
date
Dec 20, 2023
slug
loss-versus-rebalancing-101
type
Post
status
Published
Author: Alphaist

Introduction

In this article, we will try to understand Loss versus Rebalancing which is currently the most important issue in the DEX. Before we begin We’d like to ask you one quiz first. Suppose you bought Apple stock yesterday for $100 and were able to sell it for $110. Was this a good deal? Most people would probably say it was a good deal.
But is it really? Now suppose the S&P 500 ETF had risen from $100 to $120 in the same period. Your investment has not produced a return below the market average. If your reason for investing is purely in Apple itself, no problem, but if your goal is to maximize your own portfolio value, you should have bought an ETF in the S&P 500. Of course, this is a bit of a strong assumption since it is based on a single day, but if you have the same situation over a longer period of time, you may have profited in absolute dollars, but in relative terms you have lost an opportunity for further gains.
Something similar occurs with liquidity provision in the DEX. The concept of ‘Loss versus Rebalancing’ can be viewed as a transfer of value outside the application, stemming from the information asymmetry between the informed trader and the liquidity provider. On the other hand, it serves as a useful indicator for comparing the opportunity losses between the Rebalancing Portfolio and the Liquidity Provider’s portfolio. This means you can assess whether you’re taking on the market’s risk or the inherent risk of the Liquidity Provider (LP) when offering liquidity. Suppose you’ve made a 10% return on your liquidity offering. You can now evaluate whether this transaction is advantageous or not, in the context just described.

Overview of Loss versus Rebalancing

Loss versus Rebalancing is a measure of the LP of an AMM based on a paper published in August 2022 by Jason Milionis, Ciamac Moallemi, Tim Roughgarden, and Anthony Lee Zhang. The paper contains very advanced mathematical content, including stochastic process theory and the Black-Scholes model, which may be difficult for many DeFi users to understand.
In this article, we will try to make such content understandable to many readers by applying specific numerical values and supplementing the mathematical formulas. We will start with a simple example to help you better understand Loss versus Rebalancing, and then add more detailed explanations towards the bottom of the article.
Now, as an example, let’s consider providing liquidity to UniswapV2. You provide liquidity of 1 ETH and 1000 USDC or a total of $2000, when 1ETH = 1000USDC at t = 0. On the other hand you hold an additional 1 ETH and 1000 USDC. Note that the Rebalancing Portfolio is based on the CEX price for buying and selling assets. Also note that the Rebalancing Portfolio has nothing to do with rebalancing, which may be thought of as changing the price range for providing liquidity in a DEX with concentrated liquidity, such as Uniswap V3.
Let’s use an example to illustrate liquidity provision in UniswapV2. Imagine you’re providing liquidity with 1 ETH and 1000 USDC, which totals $2000 at the initial time, 1ETH = 1000USDC at t = 0. In addition to this, you also hold another set of assets comprising 1 ETH and 1000 USDC separately. It’s important to note that the ‘Rebalancing Portfolio’, in this context, refers to the strategy of buying and selling assets based on the Centralized Exchange (CEX) prices. Also, it’s crucial to understand that this Rebalancing Portfolio is distinct from the concept of ‘rebalancing’ in the context of a Decentralized Exchange (DEX) with concentrated liquidity, like Uniswap V3. In the latter case, ‘rebalancing’ typically involves adjusting the price range for providing liquidity.
Now suppose that 1ETH = 4000USDC at t = 1. In this case, LP’s portfolio will be composed of 0.5 ETH and 2000 USDC according to the formula x*y=k. Portfolio Value will be 0.5ETH * 4000USDC + 2000USDC which is $4000.
Now consider the composition of the Rebalancing Portfolio. As mentioned earlier, the Rebalancing Portfolio always rebalances at the CEX price. Therefore, let us assume that the Rebalancing Portfolio is composed of 1 ETH and $1000 USD, and given that 1 ETH is $4000 USD, 1ETH * 4000USDC + 1000USDC = 50000USDC. In other words, compared to the LP portfolio, we have gained $1000 more relative to the LP portfolio. Many people think that this is the same indicator as Imparment Loss. It is true that they are the same up to this point, but this is where we can understand the difference between the two.
Suppose that 1ETH = 1000USDC again at t = 2.In this case, IL is 0. However, the LVR is different, because LP’s portfolio will again consist of 1 ETH and 1000 USDC. Therefore, the Portfolio Value is 1ETH * 1000USDC + 1000USDC, which is $2000. The Rebalancing Portfolio on the other hand is 1ETH * 4000USDC + 1000USDC, but to duplicate the LP portfolio mentioned earlier, it will be rebalanced to 0.5ETH * 4000USDC + 3000USDC. And the current price of ETH is 0.5ETH * 1000USDC + 3000USDC = 3500USDC since 1ETH = 1000USDC.
If we rebalance again at the CEX price 1ETH + 2500USDC. We have prevented a loss of $500 relative to the LP portfolio. The Imparment Loss metric can’t capture this loss if the price is the same at the time of liquidity and at the time of dismantling. And the important thing about LVR is that it is always cumulative, regardless of the direction of price changes. This is precisely the meaning of the expression “non-negative”, “non-decreasing” in the paper. Of course the assumptions made in the paper are highly optimistic; in reality, one must take into account gas costs, spreads, fees in centralized exchanges, and so on.

Unveiling the Depths of Loss versus Rebalancing

From this point on, we will use the formulas and graphs included in the paper to further our understanding of LVR.
notion image
This equation is very important when considering the Rebalancing Portfolio. This formula is described in the paper as self financing strategy, and it shows that the P&L of the portfolio is affected by the price change of the riskey asset per minute. The equation is somewhat mathematically esoteric, but it can be thought of as a direct representation of the P&L that would be incurred if the Rebalancing Portfolio were constructed as described earlier: xt = 1Pt = $4000yt = 1000x0 = 1P0 = $1000, and y0 = 1000. In this case, xs = 1dps = $3000, so 3000 is consistent with the previous example. In this case, since we are only dealing with a single point in time, the integral sign or even the Σ sign is too much to handle, but it is important to understand that this formula itself is only focusing on the P&Lof the Rebalancing Portfolio from time 0 to time t.
notion image
We could then construct a Rebalancing Portfolio by setting V0 with the same amount of assets as provided liquidity at the start as in the above equation. LVR can be defined as the difference between this Rebalancing Portfolio and the LP portfolio provided to DEX.
LVR is often regarded as an AMM-specific problem, but it can occur even in a limit order book. This is because LVR is an outflow of value outside the application due to information asymmetry between the informed trader and the liquidity provider. And the root cause of this information asymmetry is due to the mechanism of Blockchain itself. For example, Ethereum’s block-time is nearly 12 sec. What this means is that no matter what happens outside of the blockchain, the information can’t be captured within the blockchain for 12 sec. In the case of a centralized exchange, no such restriction occurs and the price changes continuously. This causes the CEX and DEX prices to diverge, and if they diverge enough for the Arbitrager to consider gas, slippage, etc. and expect to make a profit, CEX-DEX arbitrage is executed.
Now, we will explain the process of LVR step by step. The important point is to understand how the trading is executed by the Arbitrager and the Liquidity Provider when this CEX-DEX Arbitrage occurs.
notion image
This graph demonstrates that, when disregarding the fees, the LP’s portfolio will invariably be subordinate to the rebalancing portfolio. This is attributed to the LP consistently trading at a price lower than that of the rebalancing portfolio. As depicted by the red line in the graph, representing the current market price (Pt), it’s evident that the LP’s trading price is always less favorable when compared to the rebalancing portfolio.” There is no arbitrage between CEX and DEX because the prices of DEX and CEX are identical. Suppose that the price of CEX then changes to brown Pt + dPt. In this case, a price difference between CEX and DEX occurs and an arbitrage opportunity arises. The problem here is that when arbitrage takes place, the price fluctuates along the Curve of the CFMM, which is not a brown line through point B*. Thus, the execution price for an LP is not strictly Pt + dPt, but the purple line, Pt + dPt / 2. Thus, a profit of B* — B is available to the Arbitrager. The LP suffers a loss if this arbitrage profit is not covered by the swap fee the LP receives.
Now, as stated in the paper, the above situation can be expressed in the following equation: When an Arbitrager arbitrates dx, it buys at CFMM at the execution price of Pt + dPt / 2 and sells at CEX at the price of Pt + dPt.
notion image
It’s mean that the profit of the arbitrager is the amount of the micro-risk asset multiplied by the micro-change in price divided by two. Conversely, this is a loss for the liquidity provider. Now let us turn our attention to dx, which, when one thinks of CFMM, brings to mind the equation x*y=k.However, this is a function that focuses on the quantity of each asset and is not explicit about the price. Price is the slope of the tangent line obtained by differentiating x*y=k. dx can rather be interpreted as a function of price. In other words, it is how much x the Liquidity Provider gains or loses by making a small change in price. Because an increase in the price of x in the AMM means that some x has left the pool. Thus, the formula is as bellows.
notion image
What this formula says is how much of a risky asset is traded for a minute change in price. To put it concretely, for a $1 change in price, 100 ETH would be traded. In this case, dx is $100. In the paper, this liquidity is labeled as marginal liquidity. In addition, it can be understood from this formula that x is a function of P, and even if the price change is small, if the liquidity offered is huge, the arbitrager can make a lot of profit. In other words, even if the price changes only slightly, it does not necessarily mean that there is no arbitrage opportunity at all.
notion image
Finally, the above equations can be combined to define LVR. In other words, LVR can be interpreted as the sum of the profits that can be earned by the Arbitrager from time 0 to time t in continuous time.

Types of Order Flow

We have been trying to understand LVR from its overview and mathematical aspects. Many people may think that if LVR is non-negative and non-decreasing, LPs will lose money, as there is no way to counteract it, no matter how much fees they can earn. However, this is not necessarily the case. This is because not all orders on the DEX are placed by arbitragers.
To begin with, we can distinguish two types of user trading.
  • Informed trading
  • Uninformed trading
Informed trading is trading by arbitragers. They constantly monitor exchanges and earn profits by arbitraging the difference in price when there is a price difference between exchanges. In the on-chain world, it appears in the form of CEX-DEX and DEX-DEX arbitrage. In this post, we will focus on CEX-DEX arbitrage, in which an arbitrager constantly monitors the DEX and trades when a certain discrepancy occurs between the market price and the price presented by the DEX. To express informed trading more simply, any order that brings the DEX price closer to the true market price can be considered informed trading.
On the other hand, uninformed trading is a case where a user trades for his/her own reasons. For example, when a trader needs additional collateral or margin and executes a trade using DEX. To explain this more simply, any order to move the DEX price away from the actual market price can be considered uninformed trading. The characteristic of this uninformed trading is that it is an order that does not cause a price impact on DEX. For example, suppose a trader wants to exchange 10 ETH for 10000 USDC. If this is done using Uniswap, there will of course be an instantaneous price impact of 10 ETH. However, this price impact is immediately offset by the back run by the informed trader.
Thus, from the LP’s perspective, they theoretically get the swap fee paid by the uninfromed trader and the backrun fee of the informed trader, without causing any price impact at all. In other words, providing liquidity is all about capturing this uninformed flow. To be more precise, liquidity should be provided to the DEX if the arbitrage profit earned by the arbitrageur can be covered by the fee income from the uninformed flow and the commission paid by the informed trader.
So far, we have been talking on the assumption of a passive Liquidity Provider, but if the Liquidity Provider can actively manage the provided liquidity like a Market Maker in the existing financial market, the Liquidity Provider may be able to get a profit.
In fact, the concept of Just In time Liquidity (JIT) is not very common, but it has been observed. JIT is the process of providing and withdrawing liquidity before and after swap transaction, and earn instantaneous fee income.
As a concept, this seems to make sense but it is important to ask who exactly is doing this trading. It will be the Seacher, not the typical Liquidity Provider, who bundles this series of transactions.
For a searcher engaged in crypto trading, opting for Just-In-Time (JIT) for handling uninformed flow is not always the most advantageous approach. It is crucial for the searcher to devise a bundle that maximizes value extraction, particularly for inclusion in the Builder. However, the searcher has alternative methods at their disposal, such as Backrun and Sandwich Attack. JIT are utilized only when they present the highest profit potential. Currently, the use of JIT in trading strategies is relatively infrequent, constituting a small percentage of total trading activities.
In the first place, in DEX, including Ethereum, the relationship between makers and takers that occurs in existing finance is difficult to establish. This is because that as we mentioned earlier, providing liquidity is about capturing uninformed flows. So is it possible for Liquidity Providers to avoid informed flows and continue executing uninformed flows? First of all, in Ethereum, gas costs are extremely high, making it difficult to provide and cancel high-frequency liquidity. Another thing to consider apart from the gas cost is the order of ordering. On the NASDAQ and NYSE, traders place orders using the FCFS method in which a central server prepares a queue of processes waiting to be executed and executes them in order, starting with the first registered process. However, it is extremely difficult to establish this mechanism, especially in decentralized systems such as Ethereum.
In fact, in Ethereum, the block builder controls the order of orders and bundles and orders are included in blocks in the order that allows building blocks of higher value. And now there is a tendency for CEX-DEX arbitrage transactions to be lined up at the top of the block. Orders that ultimately withdraw liquidity from the DEX will be executed after the CEX-DEX arbitrage. Therefore, liquidity is exposed to informed flow. The condition for the Builder to place an order to withdraw liquidity from the DEX before the CEX-DEX Arbitrage is to make this order more valuable than the Arb trade, but that would be putting the cart before the horse. It is extremely difficult to do active Liquidity Providing, especially in Ethereum.

Risk of Liquidity Provision

From here, we will consider how the P&L of an LP can be explained in light of the above. If we consider the P&L of an LP position from time 0 to time t, it is shown that it can be decomposed into the following three components
notion image
  • Market risk: This is consistent with the P&L of the rebalancing strategy discussed earlier. This means that it is literally affected by price fluctuations of risk assets such as ETH.
  • Fee: This is the swap fee that Liquidty providers receive in return for contributing their assets to the liquidity pool.
  • LVR: As mentioned above
What can be understood from this is, as mentioned in the introduction, the type of risk one takes when providing liquidity.
notion image
Suppose we eliminate market risk by continuously delta hedging the LP portfolio, as described in the paper, by hedging the rebalancing portfolio described above. In this case, the LP’s P&L is defined as the difference between the fee and the LVR. In other words, an LP is justified in providing liquidity if its fees exceed its LVR. If the fee is subordinate to the LVR, it is better to hodl the underlying asset, even if it simply provides liquidity to the DEX.

Solution for Loss versus Rebalancing

Finally, We’d like to briefly discuss a few proposed solutions for mitigating LVR.

1. Block-time

The first is to provide liquidity with a blockchain that has a short blocktime. This is not a problem that can be easily solved by the application side, so it is a measure that can be taken by the user side.
As can be understood from the previous equation, LVR is affected by the square of the instantaneous volatility, i.e., the instantaneous variance. This means that if the price change doubles, it will be squared and therefore the LVR will quadruple. Conversely, halving the Blocktime means that the LVR is reduced by a quarter. Therefore, if liquidity is provided to DEX in Arbitrum rather than Ethereum, the impact of LVR itself will be smaller. However, providing liquidity is not always recommended just because the Blocktime is faster. As mentioned earlier, liquidity provision is all about getting uninformed trading. Therefore, if there are no users and most of them are arbitrage traders, the liquidity provider will lose money.

2. Dynamic fee

There is a dynamic fee. This dynamic fee has two different policies.
The first is to determine the fee according to volatility. As mentioned earlier, LVR depends on the square of the instantaneous volatility. If the volatility is higher than the standard, a higher fee is set and if it is lower, a lower fee is set. This is expected to reduce the impact of LVR.
Second is to distinguish between order flows and apply a low fee to uninformed flows and a high fee to informed flows. This assumes that order flows are autocorrelated. In other words, it assumes that an informed flow will be followed by an uninformed flow.
The first problem with dynamic fees is that all traders are equally affected by the fee determined by volatility. However, the underlying cause of LVR is the outflow of value outside the application due to information asymmetry between the informed trader and the liquidity provider. Reducing the bid-ask spread for uninformed trading and increasing the bid-ask spread for informed trading will improve the quality of execution for traders in general, while increasing the profitability of the liquidity provider. This mechanism will have a more positive impact on both entities, improving the quality of execution for traders in general and increasing the profitability of liquidity providers.
It should also be noted that this mechanism can distinguish between order flows and impose dynamic fees based on the order without reference to external sources of information such as Oracle. However since this mechanism distinguishes order flow based on the first arbitrage transaction when a large price change occurs, it is not possible to charge a high fee for all arbitrage transactions. Even if an order is an uninformed flow, there may be traders who wish to execute their orders in the same direction as the informed flow. For example, in the event of a sudden price change, arbitrageurs and uninformed traders may want to execute trades in the same direction. In this case, both parties will be exposed to high fees.

3. Auction

The third is a mechanism whereby the right to trade first per block on the DEX is an auction. As mentioned earlier, the informed flow is at the beginning of the block, and in each block, the order is likely to be executed first on the DEX. While this is a very ideal mechanism, it is extremely difficult to construct an on-chain auction that includes a bid for each block, This is because in order to auction the right to place the first order in block N, it must be known who is available for trading in that pool by at least N-1. Also, in the case of on-chain auctions, the bid itself may be censored and not included in the block, and the challenges are endless.

Conclution: Loss versus Rebalancing

Loss versus Rebalancing (LVR) is an important indicator for understanding the risk/reward of providing liquidity in a DEX, as the occurrence of LVR is due to the blockchain mechanism itself rather than the DEX application itself. Provider must fully consider these factors. For example, an effective measure would be for users to migrate to blockchains with shorter block times. Also, with the advent of UniwapV4, fees, spread adjustments, and auction mechanisms to counteract LVRs could be introduced. These measures are expected to reduce risk for LPs and provide more effective liquidity provision.

Reference


© Titania Research 2024