How to protect liquidity providers (LPs) from lose on AMMs

Highlights:

  • How Impermanent loss (IL) and arbitrage cost appear

  • All the costs of liquidity providers (LPs) on AMMs

  • How BrownFi (as an innovative oracle-based AMM) mitigates IL & arbitrage loss, ensures LP gains

Impermanent Loss is common in all markets

Impermanent Loss (acronym IL, aka divergent loss) is simply the opportunity cost of adding liquidity into an AMM pool vs holding the individual tokens. IL disappears if and only if the price returns to the pool-entering price, otherwise IL becomes permanent loss. Formally, IL is measured by IL=Pool.ValueHold.Value1IL=\frac{Pool.Value}{Hold.Value}-1, being negative whenever price increases or decreases. In fact, divergent loss is a common phenomenon appearing in all financial markets, including CEXes and AMMs, at the side of market makers (MMs), or liquidity providers (LPs). However, MMs on CEXes can actively adapt to price changes very quickly, e.g. removing bids/asks with stale price and replacing them with updated orders surrounding the newly middle price. LPs on AMMs, unfortunately, have no way to do the similar actions, because they are passive to price change. Price of an AMM pool (constructed on constant product market making, aka CPMM model) is purely defined by the ratio of two token reserves, which is changed per swap by arbitrageurs or normal traders.

Why do LPs accept IL?

When providing liquidity on Uniswap and other AMMs, LPs have an ONLY hope that accumulative trading fee can cover the loss, even help them gain. Differently, MMs on CEXes earn via price spread advantage.

The costs of liquidity provision other than IL

It is impossible to completely remove IL, even higher liquidity concentration causes higher IL (e.g. on Uniswap V3’s pools). Luckily, there are some ways to mitigate IL. For example, Balancer has modified the 50/50 inventory model of Uniswap V2 to build another version of CPMM with custom inventory ratio, hence reducing IL.

Impermanent loss by price change
Impermanent loss by price change

However, inventory imbalance, in turn, is an issue of Balancer, plus opportunity cost of adverse selection in the following. Interestingly, CPMM and impermanent loss are path-independent, i.e. IL is the same for any possible price trajectories (other than its initial and final values). Although IL is zero if the initial and final prices stay the same, that concept fails to isolate the adverse selection costs (caused by arbitrageurs) faced by LPs on most AMMs. In reality, there are always price discrepancies between CEXes (continuous price discovery in real-time) and DEXes (discrete price discovery per block time), giving opportunities for arbitrageurs to take profit at the expense of LPs. Then LP costs should be increasing in the number of opportunities for AMM arbitrage. And the frequency of such opportunities is very different if the price stays the same (no arbitrage) versus if it jumps around a lot (lots of arbitrage). Half of LPs on Uniswap V3 suffer losses due to high IL and out-of-range positions. Sorella Labs has tracked (in real time) that, since the Merge, LPs on Ethereum have lost over $750M due to arbitrate. In general, A16Z researchers have raised the loss versus rebalancing (LvR) problem, which put arbitrage cost as the opportunity loss of liquidity provision.

How oracle-based BrownFi AMM protects LPs?

Suppose an AMM pool (e.g. on Uniswap V2 and V3 with bonding curve xy=kx* y=k for both) has 1 ETH and 1000 USDC. Suppose further that at a very good moment for ETH, the market price jumps from $1000 to $4000. This requires a swap of 1000 USDC to receive 0.5 ETH, and the post-trade pool ratio is 0.5 ETH : 2000 USDC. In this case, the decision to provide liquidity would have doubled your money from a $2000-value portfolio on deposit to a $4000-value one upon withdrawal. Consequently, providing liquidity on the AMM cause your loss of $1000.

If you sell 0.5 ETH on a high liquid CEX (e.g. Binance) at $4000, after that, your portfolio (0.5 ETH, 3000 USDC) value is $5000 dollars, equal holding portfolio.

Now, let’s see how BrownFi works with the initial (1 ETH, 1000 USDC) reserve and the same trade of buying dx=0.5dx=0.5 ETH at the market price $4000. With a high liquidity concentration (parameter Kappa K=0.001K=0.001), BrownFi’s pricing formulas read.

  • Price impact factor R=K×dxxdx=0.001×0.510.5=0.001R=K\times \frac{dx}{x-dx}=0.001 \times \frac{0.5}{1-0.5}=0.001

  • Trading price Pt=4000(1+R/2)=4002P_t=4000(1+R/2)=4002, so paying dy=dxPt=2001dy=dx * P_t=2001 USDC.

Thus, the LP portfolio on BrownFi AMM is (0.5 ETH and 3001 USDC) valued $5001 dollars, higher than holding. Without trading fee, what is $1 dollar greater than the holding portfolio? It is exactly the price impact cost BrownFi AMM charges per trade. It is LPs’ incentives (plus trading fee) to provide liquidity.

You may ask “trading on BrownFi AMM (and Binance) is worse than Uniswap V2” (because paying USDC doubly). NO. In fact, the trade on Uniswap is made by smart arbitrageurs who have the best tools to hunt profitable opportunities effectively upon price discrepancies at the expense of LPs and/or normal traders (i.e. LvR problem). Let’s see next.

Now, assume the 2nd trade that the market price stays the same at $4000, and a normal trader wanna buy 0.1 ETH. The Uniswap pool, after the first trade, has 0.5 ETH and 2000 USDC. Solving by xy=kxy=k formula (0.50.1)(2000+dy)=0.5×2000(0.5 – 0.1)(2000 + dy)=0.5\times 2000. The trader pays dy=500dy=500 USDC, meaning 25% more expensive than the market price. The post-trade pool is 0.4 ETH and 2500 USDC, priced $6250 per ETH, much higher than the market price. This, again, gives an arbitrage opportunity to sell 0.1 ETH back to the pool (the 3rd trade), receiving 500 USDC, roughly taking 100 USDC profit at the expense of the previous trader. Eventually, the portfolio on Uniswap pool is (0.5 ETH and 2000 USDC) valued $4000, as same as the value after the 1st trade with IL of $1000.

After the first trade, BrownFi AMM pool has 0.5 ETH and 3001 USDC. Then we have the 2nd trade (buying dx=0.1dx=0.1 ETH)

  • Price impact factor R=K×dxxdx=0.001×0.10.50.1=0.00025R=K\times \frac{dx}{x-dx}=0.001\times\frac{0.1}{0.5-0.1}=0.00025

  • Trading price Pt=4000(1+R/2)=4001P_t=4000(1+R/2)=4001, so paying dy=dxPt=400.1dy=dx * P_t=400.1 USDC with negligible slippage.

The portfolio on BrownFi AMM pool is now (0.4 ETH and 3401 USDC) valued $5001, still higher than holding, and no arbitrage opportunity.

Without loss of generality, the previous examples take an extreme price volatility (for easy computation & reading) to illustrate that Uniswap V2 and V3 models are exposed to both IL and arbitrage loss. Arbitrageurs take profits at the expense of either LPs or ordinary traders. In contrast, BrownFi is an oracle-based AMM, always offering trade at market price plus a price impact cost. Therefore, by eliminating arbitrage opportunities, BrownFi AMM mitigates overall loss and guarantees gains of LPs.

The following table summarizes the state changes from the initial portfolio of 1 ETH, 1000 USDC throughout 3 trades with the market price of 1 ETH = $4000 dollars, and 1 trade when the price returns $1000. With this setting (same token reserve and price path), Uniswap V2 & V3 are identical by using the same formula x×y=kx\times y=k. Trading fee is ignored for simplicity (but no impact on our consideration). If you choose a lower price (e.g. $2000 or $500), the absolute values change with small numbers of many decimals, but the relative quantities and implied properties are still the same. Thus, it doesn’t affect our conclusions on the nature of exchange models. ETH reserve is green while USDC reserve is white.

Table 1: Comparing LP costs and portfolios. The holding value is $5000.
Table 1: Comparing LP costs and portfolios. The holding value is $5000.
Table 2: Comparing LP costs and portfolios. The holding value is $2000.
Table 2: Comparing LP costs and portfolios. The holding value is $2000.

In the table 2, LPs on Uniswap has zero IL when the price returns to the initial pool setting. However, at the end of the illustration, arbitrageurs earn $1600 at the cost of LPs ($1000 at the 1st trade and $500 at the 4th trade) and normal trader ($100 at the 3rd trade). On the other sides, LPs on Binance and BrownFi have $1500 gains, because they always offer liquidity at market price (arbitrageurs could not take profit at the 1st and 4th trades).

Is BrownFi AMM better Uniswap?

It is worth clarifying that impermanent loss is only suitable for Uniswap and AMMs (e.g. Balancer, Sushiswap, Pancakeswap) using CPMM models, which offer independent price discovery mechanisms. Regarding BrownFi and other oracle-based AMMs (e.g. Dodo, Lifinity) possessing price-ambience, a universal consideration of LP costs, including arbitrage cost, is more precise. In the two table above, by copying the initial pool setting, universal market price and trades, BrownFi outperforms CEX and holding with a small gain +$1 for LPs, while Uniswap makes them a huge loss for arbitrageurs. In practice, under market dynamics, market making is more complicated with many scenarios. However, one thing is still valid that BrownFi, in general, all oracle-based AMMs, are resistant to arbitrage and sandwich attacks (given sub-second blocktime and reliable oracle), thus ensure better gains for LPs by taking LvR from arbitrageurs. In reality, blockchains with long block time (e.g. Ethereum) facilitate arbitrage trades, while blockchains with sub-second block time make them much harder.

Don’t get me wrong, Uniswap and CPMM-AMMs discover price independently, hence are the only choice for tokens unlisted on CEXes. BrownFi only works if a reliable price source is available. Uniswap and CPMM-AMMs play a vital role in decentralized finance (DeFi). BrownFi, an oracle-based AMM, is a complementary solution to the CPMM-based AMM models. If oracle-price is reliable and dominant (e.g. tokens listed on CEXes with good liquidity), BrownFi AMM is potential to outperform Uniswap V3. Readers can find a comprehensive article about oracle-based AMMs here.

In general, profit and loss of LPs is PnL = pool value - hold value. The pool value contains IL, trading fees, LvR. To mitigate overall cost (e.g. IL, LvR) of LP and make LPs gain, there are 3 methods:

  • Reduce impermanent loss (Uniswap V2 does). Higher liquidity concentration, higher IL. In fact, IL on Uniswap V3 is greater than V2, narrower range, larger IL.

  • Reduce arbitrate attacks (or LvR in general), hence arbitrage gains are transformed to LP gains. This is what BrownFi does.

  • Combining the two methods above in an equilibrium based on suitable and flexible market making strategies. This is the advanced feature BrownFi offers along with simplified UX for average LPs to help them optimize profit and minimize loss (so optimal PnL).

BONUS: In reality, token reserve and trades are very different, not the same as in the previous illustration (i.e. copying Uniswap). IL and LP loss vary according to market movement (in real time) and liquidity provision strategies. For instance, MMs on Binance can suffer huge IL if they sell a large amount of 0.8 ETH at $1000 price, then their portfolio value at $4000 price is $2600 (much lower than Uniswap $4000 and holding $5000). This is similar to providing liquidity on Uniswap V3, if you add LP with a narrow range at low price, then price jumps very high, you suffer great IL. Don’t be upset. We will have another article analyzing loss and gain of Uniswap’s neutral liquidity provision strategy and other strategies (including BrownFi AMM). Remember NO free lunch. Please stay tuned for the next article, where we will describe how BrownFi helps LPs optimize their PnL.

Contact us

WebsiteTwitterTelegramblog

Subscribe to BrownFi AMM
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.