๐Concentrated Liquidity (CLAMM)
Concentrated liquidity with fees-adjusted pricing
Last updated
Concentrated liquidity with fees-adjusted pricing
Last updated
DerpDEX's concentrated Liquidity Automated Market Maker (CLAMM) focuses on maximising capital efficiency with better UX with fees-adjusted pricing. This not only allows LPs to earn a higher return on their capital but also dramatically improves trade execution that can now be comparable or even surpass the quality of both centralised exchanges and stablecoin-focused AMMs.
On top of this, because of better capital efficiency, LPs can create overall portfolios that significantly increase exposure to preferred assets and reduce their downside risk. They can also add single assets as liquidity to a price range that is above or below the current market price which basically creates a fee-earning limit order that executes along a smooth curve.
This is all possible by introducing a new concept of concentrated liquidity with adjustable fees-pricing mechanism. These features not only provide liquidity providers (LPs) with more options, but also achieves up to 4000x capital efficiency compared to the existing AMM protocol.
When LPs provide liquidity to a standard AMM pool, liquidity is distributed evenly along the price curve. Although this allows for handling all price ranges between 0 and โ, it makes the capital quite inefficient. This is because most assets usually trade within certain price ranges. This is especially visible in pools with stable assets that trade within a very narrow range.
As an example, standard AMM USDT/USDC pool only uses around 0.5% of capital for trading between $0.99 and $1.01 โ a price range where the vast majority of trading volume goes through. This is also the volume that makes the majority of trading fees for the LPs.
This means that in this particular example, 99.5% of the remaining capital is pretty much never used.
In CLAMM, LPs can choose a custom price range when providing liquidity. This allows for concentrating capital within ranges where most of the trading activity occurs. To achieve this, DerpDEX creates individualised price curves for each of the liquidity providers.
Before CLAMM, the only way to allow LPs to have individual curves was to create a separate pool per curve. These pools if not aggregated together resulted in high gas costs if a trade had to be routed across multiple pools.
What is important is that users trade against combined liquidity that is available at a certain price point. This combined liquidity comes from all the price curves that overlap at this specific price point. LPs earn trading fees that are directly proportional to their liquidity contribution in a given range.
The Generalized Weighted Function formula calculates the pricing and weight distribution of tokens within a liquidity pool based on the desired concentration of liquidity in different price ranges. It is a flexible formula that allows liquidity providers to customize the allocation of liquidity according to their preferences. The formula can be represented as follows:
In this formula:
P represents the price of a token within a specific price range.
B represents the balance of the token within the price range.
W represents the weight assigned to the token within the price range.
S represents the total weight of all tokens in the price range.
Concentrating liquidity offers much better capital efficiency for liquidity providers. Alice and Bob both decide to provide liquidity in the ETH/USDC pool on DerpDEX. They each have $10,000 and the current price of ETH is $1,750.
Alice splits her entire capital between ETH and USDC and deploys it across the entire price range. She deposits 5,000 USDC and 2.85 ETH.
Bob, instead of using his entire capital, decides to concentrate his liquidity and provides capital within the price range from 1,500 to 2,500. He deposits 600 USDC and 0.37 ETH โ a total of $1200 and keeps the remaining $8800 for other purposes.
What is interesting is that as long as the ETH/USDC price stays within the 1,500 to 2,500 range, they both earn the same amount of trading fees. This means that Bob is able to provide only 12% of Aliceโs capital and still makes the same returns โ making his capital 8.34x more efficient than Aliceโs capital.
On top of that, Bob is putting less of his overall capital at risk. In case of a quite unlikely scenario of ETH going to $0, Bobโs and Aliceโs entire liquidity would move into ETH. Although they would both lose their entire capital, Bob puts a much smaller amount at risk.
LPs in more stable pools will most likely provide liquidity in particularly narrow ranges. If the $25M currently held in the standard AMM USDT/USDC pool were instead concentrated between 0.99 โ 1.01 price range in DerpDEX CLAMM, it would provide the same depth as $5B in AMM as long as prices stayed within that range.
With DerpDEX, the maximum capital efficiency will be at 4000x when compared to standard AMM. This will be achievable when providing liquidity within a single 0.1% price range. On top of that, the DerpDEX pool factory will be able to support ranges as granular as 0.02% โ which translates to a maximum of 20,000x capital efficiency relative to standard AMM.
DerpDEX also includes the concept of active liquidity. If the price of assets trading in a specific liquidity pool moves outside of the LPโs price range, the LPโs liquidity is effectively removed from the pool and stops earning fees. When this happens, the LPโs liquidity shifts completely towards one of the assets and they end up holding only one of them.
At this point, the LP can either wait until the market price moves back into their specified price range or they may decide to update their range to account for current prices.
Although it is entirely possible that there will be no liquidity at a specific price range, in practice this would create an enormous opportunity for liquidity providers to indeed provide liquidity to that price range and start collecting all trading fees.
From the game theory point of view, we should be able to see a reasonable distribution of capital with some LPs focusing on narrow price ranges, others focusing on less likely but more profitable ranges and yet another ones choosing to update their price range if the price moves out of their previous range.
Range Limit Orders allows LPs to provide a single token as liquidity in a custom price range above or below the current market price. When the market price enters into the specified range, one asset is sold for another along a smooth curve โ all while still earning swap fees in the process.
This feature, when used together with a narrow range, allows for achieving a similar goal to a standard limit order that can be set at a specific price.
For example, letโs assume that USDT/USDC trades below 1.001. An LP can decide to deposit their USDT to a narrow range between 1.001 and 1.002. Once USDT trades above 1.002 USDT/USDC the whole LPโs liquidity is converted into USDC. At this point, the LP has to withdraw their liquidity to avoid automatically converting back into USDT once USDT/USDC goes back to trading below 1.002.
LPs can also decide to provide liquidity in multiple price ranges that may or may not overlap. For example, an LP can provide liquidity to the following price ranges in the ETH/USDC pool:
$2000 between $1,500-$2,500
$1000 between $2,000 โ $3,000
$500 between $3,500-$5,000
Being able to enter multiple LP positions within different price ranges allows for approximating pretty much any price curve or even an order book. This also enables creating more sophisticated market-making strategies.
Price Tick refers to the minimum price movement or increment at which the price of an asset in a liquidity pool can change. It represents the smallest unit by which the price can be adjusted or updated.
The price tick is determined by the liquidity protocol or exchange on which the liquidity pool operates. It is designed to maintain price precision and prevent unnecessary price fluctuations caused by small trades or insignificant market movements. By having a minimum price tick, the liquidity protocol ensures that price updates reflect meaningful changes in the market.
As each LP can basically create their own price curve, the liquidity positions are no longer fungible and cannot be represented by well-known ERC20 LP tokens. Instead, provided liquidity is tracked by non-fungible ERC721 tokens. Despite this, it looks like LP positions that fall within the same price range will be able to be represented by ERC20 tokens either via peripheral contracts or through other partner protocols.
On top of this, trading fees are no longer automatically reinvested back into the liquidity pool on LPsโ behalf. Instead, peripheral contracts can be created to offer such functionality.