Concentrated Liquidity versus Constant Product (CLMM versus CPMM)

Marco_112358
7 min readApr 5, 2022

--

Providing liquidity to liquidity pools is a great way to earn yield in DeFi. Most liquidity pools are set up using the Constant Product Market Maker (CPMM) function. This function allows for liquidity to be available at all potential prices between two assets. However, the downfall of this simple and elegant concept is that Liquidity Providers (LP’ers) are exposed to Impermanent Loss (IL). I have a more detailed post around CPMM, IL, and Yield Farming/Liquidity Mining here. There are a lot of great articles and videos on IL as well.

What is really interesting about the CPMM concept is that it really provides liquidity across the spectrum of all potential prices. However, there are plenty of asset pairs that really will not trade outside of a specific band. For example, two different stablecoins pegged to the U.S. Dollar should trade relatively closely to each other. Do we really need to provide equal liquidity to a price of 1:1 as a price of 100:1, or 1000:1, etc. This is where Concentrated Liquidity Market Making comes into play. In addition, there is the concept of a stableswap invariant that Curve uses, along with Saber. This stableswap invariant also allows for efficient swapping of similar assets.

Concentrated Liquidity Market Making

Concentrated Liquidity Market Making (CLMM) is essentially the ability to provide liquidity to a pair of assets, but only in a very specific price range, instead of the infinite price range of the CPMM. This allows for deeper liquidity for the asset pair and less slippage for large trades that want to use an Automated Market Maker. CLMM is like CPMM on steroids (or levered). It is taking more risk (higher volatility and higher IL) for more reward (more fees per dollar invested).

The actual mechanics of CLMM can vary, and the functions and logic can be a little confusing. But there are a couple really important points to consider.

  • You must provide a range of prices you want to provide liquidity for. The tighter the range, the more risk you are taking. The wider the range, the less risk (but still more than CPMM!). If you set the range from 0 to infinity, the CLMM converges to CPMM.
  • If the price of the pair of assets falls outside of your range, you LP position is essentially inactive. You are not earning any fees.
  • In addition, if the price of the pair of assets falls outside of your range, you are left with only 1 of the 2 assets you may have initially supplied. So if the price of ETH/USDC falls below your range, you are left with only ETH. If the price of ETH/USDC increases above your range, you are left with only USDC.
  • You rarely supply the assets in the traditional 50/50 value you are used to. There is only 1 price near the middle of your range (near not exactly the middle) where your value of the two tokens is 50/50 (that price is sqrt(lower bound * upper bound)). This is very different than the CPMM where the value is always 50/50 for a 50/50 CPMM pool.
  • You have the potential to earn more fees per dollar invested versus a CPMM, but only if the price of the assets is inside of your range.
  • You have the potential for more IL as well. IL is exacerbated (levered, multiplied) relative to a CPMM LP.
  • Unless you are providing Concentrated Liquidity to highly correlated (very similar assets), you will want to actively manage your LP position. CLMM is not for the faint of heart!

Stylized Example of CPMM, CLMM and Holding

For me, the easiest way to understand how something works is to see a stylized example of it.

Let’s set up our example. There are 2 tokens, token X and token Y. Token X is the risky token, token Y is a stablecoin, pegged to USD and is always 1:1 with USD. The initial price of token X = $100. You want to deposit 5 of token X and 500 of token Y (supply of X = x = 5, supply of Y = y = 500, so y/x = 100 = Price of X / Price of Y), for a total initial investment of $1000.

You have 4 options to choose from.

  1. Hold your tokens exactly how you have them, x=5 and y=500 (blue line).
  2. Supply liquidity to a CPMM, initially supply x=5 and y=500. This ratio will change as the price changes (orange line).
  3. Supply liquidity to a CLMM, initially supply x=5 and y=500. Set your lower and upper bounds of your price range is 66.67 and 150. You no longer receive any fee yield if the price of X / price of Y (or supply y / supply x) is outside of 66.67–150 (grey line).
  4. Supply liquidity to a CLMM, initially supply x=5 and y=500. Set your lower and upper bounds of your price range is 83.33 and 120. So you no longer receive any fee yield if the price of X / price of Y (or supply y / supply x) is outside of 83.33–120 (yellow line). This is the most concentrated and most risky position.

Let’s allow the price of X to go from 50 to 200 (so down 50% and up 100% from the initial price of 100). And lets take a look at what happens when you receive no fees, just looking at IL (opportunity cost of price action) by itself.

This shows you the total Profit/Loss from each trade as the price of X increases or decreases. Holding is a straight line (delta 1). CLMM is 100% token X (risky token) when the price of X is below the lower bound (so a straight line/delta 1). CLMM is a 100% token Y (stablecoin) when the price of X is above the upper bound (flat horizontal line/delta 0).
This shows you the IL (trade profit/loss minus holding profit/loss) from each trade as the price of X increases or decreases.

You can see, the more concentrated the range, i.e. the closer your lower and upper bounds are to each other, the more risk you are taking.

Now let’s also look at the exact same example, but assume fees are involved. Let’s look at a 1% fee for the CPMM, which is $10 for your initial $1000 CPMM. The fee will be higher than 1% for both CLMM positions since they are essentially leveraged trades.

This shows you the total Profit/Loss from each trade as the price of X increases or decreases. Holding is a straight line (delta 1). CLMM is 100% token X (risky token) when the price of X is below the lower bound (so a straight line/delta 1). CLMM is a 100% token Y (stablecoin) when the price of X is above the upper bound (flat horizontal line/delta 0).
This shows you the IL (trade profit/loss minus holding profit/loss including fees) from each trade as the price of X increases or decreases.

You can see, the more concentrated the range, the closer your lower and upper bounds are to each other, the more risk you are taking BUT the more reward you get from fees, especially if the price of X stays roughly similar to 100 over the life of the trade. (Note: I assumed you always received the fees. This may not be the case because as soon as the price moves outside of your range, you no longer receive any fee yield from your LP. Your LP is inactivated).

One more interesting view is below. This shows you what percentage of your position’s value is in the risky token. So for a CPMM, you are always 50% risky token, 50% stablecoin. When you hold, as the price of X increases, the value of the risky token X increases while token Y value stays at 500 (so the curve is upward sloping and concave). The CLMM are interesting and important. This shows that when the risky token X price falls below your lower bound, you end up with 100% that risk token. When the price of token X rises above your upper bound, you end up with 0% risky token, 100% stablecoin. Everywhere in-between your defined range, your ratio of risky token to stablecoin is changing.

Conclusion

Concentrated Liquidity is a great addition to the DeFi ecosystem, especially the AMM space. However, LP’ers need to understand the risk they are taking when they initiate Concentrated Liquidity positions; they are taking on more risk for more reward. There has been talks in DeFi around Concentrated Liquidity solving the IL issue of CPMM. A Uniswap v3 implementation of CLMM does the opposite, it actually increases the potential IL. Please be careful, try to understand the nuances of the implementation. DeFi is only getting more complicated.

There are some novel solutions out there that try to limit the IL of CLMM/CPMM. The most interesting to me currently is LIFINITY Protocol and DeltaFi. These protocols use Oracles to see the ‘true’ price on an asset, and then set their bid-ask spreads and rebalance their pools dynamically. LIFINITY Protocol likes to use the term “Market Making Profit” MMP to describe their market making. Its a combination of IL, dynamic rebalancing, and earning the spread between bid and ask prices. MMP can be positive or negative (their live results are looking great so far!). I think of Lifinity as a Decentralized Traditional Market Maker.

I would love to hear how other protocols are tackling the IL issues. Please feel free to reach out on discord or twitter, and/or leave a comment below.

But for now, CLMM and CPMM both have IL. Both CLMM and CPMM have their place in the DeFi ecosystem, along with stableswap Market Makers. CLMM is a levered version of CPMM, higher reward for taking on higher risk. Remember, no yield is free!

About the Author

For full disclosure I mostly use Solana for DeFi, because I don’t have enough assets to justify Ethereum gas fees. I have been slowly building Cardano DeFi positions as the space is growing rapidly. I have a little bit in Algorand and Polkadot DeFi. I am actively involved in multiple Friktion volts and a contributor in their Discord, and am beta testing Dappio Wonderland 🐰. I also am in the Kitty Farmer Committee for Minswap Labs.

I am invested in SOL, ADA, ETH, DOT, ALGO, MIOTA along with plenty of other tokens.

This is not Financial Advice!

I would love to hear your feedback/questions/comments. Reach out to me on Twitter… Marco_112358, or Discord… marco_112358 in Wonderland#2400

--

--

Marco_112358
Marco_112358

Written by Marco_112358

TradFi background (CFA/CFP), DeFi Degen

Responses (1)