Deep-Dive on Metora DLMM

Deep-Dive on Metora DLMM

What is Meteora DLMM?

Meteora is one of top Dexes on Solana. The most recent product of Meteora is its DLMM feature, that's currently in beta. DLMM stands for Dynamic Liquidity Market Maker. Its an advanced feature the can be leveraged my liquidity providers to concentrate there liquidity and maximise there earnings.

Meteora DLMM: Key features and Benefits

  1. One is, Zero Slippage Price Bins, which will allow LPs to precisely concentrate their liquidity and earn more fees. This opens up a whole new world of LP strategies and new use cases.

    • Use-case: One of the use-case is Launching Tokens. It's something that the Jupiter LFG platform is taking advantage of.
  2. The second cool feature DLMM offers is **Dynamic Fees (**Fees that increase or decrease depending on how volatile the market is ). It's a first for any AMM on Solana. This means that as price volatility rises so do the fees, allows liquidity providers to capture higher fees during periods of heightened volatility when traders are less fee-sensitive.

  3. The DLMM also provides you with the flexiblity to choose your own Volatile strategy.

    • Greater flexibility and control for LPs when it comes to efficient liquidity distribution.

    • By implementing the right strategies the LPs can achieve exceptionally high capital efficiency and earn significantly higher fees.

What does it mean to provide liquidity?

When you provide liquidity what you are basically doing is that you are providing two tokens into a pool, from which users will swap and you will earn a fees for each swap made.

For example: Lets say a Liquidty Provider (LP) is providing $50 worth of USDC and $50 worth of SOL into to the pool. So what you are telling to users is that I am allowing anyone to swap between my two tokens and in exchange I will earn a fee.

Why LP?

  • Anyone wants to help in case lets say you are just holding your bonk and usdc tokens, and they just lying in your wallet so you can put them to work into a pool and earn fees from it.

Note: One important factor to keep in mind that you wont get back the same amount of tokens that you have provided for your Liquidity position. For example: If you provided SOL and USDC, then it can be the case you wont get back the same amount of SOL and USDC you put it. Maybe you get back more SOL tokens and less USDC tokens or vice-versa it all depends the price of the tokens for which you are providing liquidity.

For example:

  1. Lets say you select the sol-usdc pool as shown in below screenshot:

  2. Now, lets say you decided to provide $5 of sol and usdc and the current price for sol is 108.62 usdc then you can see half of my liquidity is in SOL and other half is in USDC.

    But if the price of SOL increases the ratio will change, i will have more usdc and less SOL and vice-versa. Does this means you lost you SOL or USDC, no you haven't its just that it has been swapped and traded for the other assets for the price you specified in the bin (Purple and blue bars in the above screenshot are bins).

What happens if the price goes out of your price range?

  • Like with any concentrated liquidity model, if the price goes out of range that you initially specified then your position becomes inactive and you will stop earning fees. Your position will also be left with only one type of token out of the pair.

    For example:

    Now, we can see the price range between 105.705191 and 111.612411. Lets say the price of sol goes beyond $111.612411 what ends up happening is that you end up with all USDC. Now, lets say the price of sol goes below $105.705191 you will end up with all SOL tokens

  • After creating your position you cannot change its price range. Now, you can either wait for the prices to return back to the range or rebalance by withdrawing liquidity/closing your position and opening a new position with a new price range.

What is Impermanent Loss?

As an LP, one risk faced is Impermanent Loss. Impermanent loss occurs when the value of the LP’s initial token deposit in the pool decreases compared to holding the tokens separately in a wallet without depositing them in a pool. If the combined value of your deposited assets in the pool is less than the value you had if you simply held the original tokens you have suffered impermanent loss. The loss is "impermanent" because its only fully realized if you withdraw your liqudity,

DLMM Over Traditional AMMs

  1. Usually in traditional AMMs when you provide liquidity you provide it for full range of prices for example when you provide liquidity for solana-usdc you are providing liquidity for the solana token at $0 all the way upto its all time high and further. This results in plenty of idle capital that is unavailable at the current price and does not capture fees. DLMM takes this away as it allows LPs to deposit their assets into specific price bins, which make better use of capital. By concentrating liqudity where its most needed, DLMMs optimize capital deployment and maximize returns for liquidity providers.

  2. Most traditional AMMs has fixed fee tiers, which means fees charged for the trade remains constant regardless of the level of trading demand or market conditions. This can lead to oppurtunity cost for LPs as during the time of high trading demand traders are willing to pay high fees to complete the trade quickly however with fixed fee tiers LPs might miss out on the opportunity to earn higher fees during these periods because they are locked into lower fee rates. DLMM takes this away by introducing the concept of Dynamic fees, now LPs can make more money when the markets are volatile.

  3. In traditional AMMs since liquidity is spread across all prices, larger trades can cause significant price impact, leading to higher slippage but when DLMM mitigates this by concentrating liquidity in a specific price range, DLMMs reduce the amount of slippage that traders experience.

Now, before comparing DLMM with other CLMMs, would like to explain what its like to provide liqudity on the DLMM.

DLMM Over CLMMs

Using CLMM you can choose to provide liqudity over a specific price range that you think the token will be trading at. This is specially usefull where trades happen within a tight range such as USDC/USDT where trades usually happen around the $0.99 - $1.01. Often, liquidity outside of this range is untouched and LPs do not earn fees. While CLMM allows you to only deposit liquidity around a certain price range but using DLMM you can also choose the distribution of your liqudity along that price range. For example: Lets says the current price of one of your assests is $10 and you expect it move in a range 8-12$. So what you can so is concentrate your liqudity around that range while concentrating most of it at $10 price bin.

But DLMM vastly improves upon what the CLMM offers with the introduction of zero-slippage price bins. Unlike CLMMs (which have slippage), the liquidity of an asset pair in the DLMM is organized into discrete price bins and the reserves deposited in a bin are available for exchange at the price defined for that particular bin.

As such, trading within an active bin has zero slippage or price impact, so LPs can expect a lot more volume going through DLMM.

We are talking about price bins a lot, now let me explain what price bins are?

DLMM Price Bins:

These vertical bars are considered as bins and liquidity is distributed across these discrete bins, where each bin represents a single price point. The active price bin is the bin that contains reserves of both token X and Y. All bins to the left of the active bin will only contain token Y, while all bins to the right of it will only contain token X. There can only be one active bin at any point in time and it will be also the one generating fees.

How are tokens swapped within a bin?

Within each bin liquidity can be exchanged at a fixed price which ensures zero slippage swaps within the bin. Basically, what happes is trades add X tokens and takes out Y tokens (or vice-versa) until there is only just 1 type of token left in a bin and the active bin shifts left or right.

All other bins excepts the active bin contains just one type of token (X or Y) as one token has been depeleted or waiting to be used in the bin.

Now, lets understand the above concept by looking at SOL-USDC pool in DLMM. From the above screenshot we can define the $106.47 SOL bin as the active bin, with all bins to the left containing only USDC and all bins to the right containing only SOL. When there is significant demand for SOL, the active bin shifts to the right as the SOL reserves in the $106.47 bin gets exhausted.

How can LP benefit from this?

Price bins allows LPs to earn a lot more fees especially for stable pairs that have less volatility. LP can review all the price bins where the current bin is, before selecting the price points they want to provide liquidity on and how deep they want to provide the liquidity. Zero-slippage bins help LPs to concentrate their liquidity further to achieve even higher capital efficiency and capture more volume and fees than they could on a CLMM.

This is especially useful for pools such as USDC-USDT pair where trades happen within tight price range. The range for USDC-USDT pair usually ranges from $0.99 to $1.01, so liquidity outside this is often untouched and LPs do not earn fees. So, as an LP concentrate most of your liquidity at an active bin of $1 and you will be able to earn fees.

Meteora DLMM Strategies:

Another benefit of why users should use Meteora DLMM as it provides LPs with flexibility to select their own volatility strategy. This flexiblity allows LPs to have greater control when it comes to optimizing for higher earnings. Currently from the Meteora DLMM UI LPs can choose from 3 strategies: Spot, Curve and Bid-Ask but using the Meteora SDK infinite strategies can be created.

How does this affect LP fees?

Advanced or Active LPs who are having good read of the market can implement the right strategy that complements the volatility of the asset pair, as they can achieve exceptionally high capital efficiency and earn significantly higher fees.

Different Volatility Strategies that you can use as an LP:

  1. Spot Strategy: This is the simplest strategy available and best for who don’t want to rebalance their position on a daily basis. In this strategy, liquidity is evenly distributed across your price range. This is similar to setting a CLMM price range. For example: If I put even amount it will get evenly distributed across the price range.

    Example:
    If you estimate that the SOL prices will remain stable between $103 to $107.75 for next 3-4 days you can provide liquidity to a SOL/USDC pool using a Spot strategy. By setting the range (with some buffer) to be $102.62 and $108.35 per SOL and by dividing the range across 69 bins you will be having a wider coverage to earns consitent fees and you wont be required to rebalance your position on daily basis

  2. Curve: In this type of strategy the liqudity is concentrated towards the center where your current market price is. This approach is ideal for stable coins or markets where price doesn't moves as much

    Example: Lets say you want to deposit liqudity in a USDC-USDT pool and stable pools have very less volatility so curve strategy would be best in this case.

  3. Bid Ask: Spot and Curve strategy are really good with small range of bins. In this strategy most liqudity is concentrated on the edges and this proves pretty usefull when the prices were to go like a swing and for this to happen markets should be pretty volatile.

    From the above screenshot we can see most of the capital is deployed on both ends across the price range from 20876.913899 to 80256.086749 bonk per jup.

Stacking Strategies using Meteora DLMM:

Another cool thing that Meteora DLMM allows LPs to do is to stack different strategies. I will explain this by guiding you through an example on how you can stack strategies.

For example: Lets say you decide to deposit liquidity in usdc-usdt pool using the spot strategy and created a liquidity position for it.

After clicking on add liquidity wait for few minutes and you will see something like this:

From the above screenshot we can see are posotion is created, now you can click on your exisiting position and then you can continue to add more liqudity to it and you can do it with different volatile strategy.
Now, lets say you are again depositing some liquidity but this time you select the curve strategy

So, whats happening here is I am stacking different strategies together and the benefit of doing this is that you would be having concentrated liquidity around where the current price is and but if the price moves further out you would still be earning as the height of the bars are still pretty good.

  • So thats how can you stack strategies and maximize your earnings. This totally depends on you as you can create any strategy

Special Use-case: Single-sided Liquidity Position

  • The DLMM provides you with an oppurtunity to provide single sided liquidity position. Liquidty doesn;t have to be both ways you can just provide liqudity for a single asset. You might want to do this because you want to utilize one token to DCA(Dollar cost Average) and buy the opposite token in the pair over time if you think the price would decrease. Single-sided liquidity positions can be paired with the volatility strategy (Spot, Curve, Bid-Ask) of your choice

    Example: You have USDC and you want to buy SOL. The current SOL price is 130.90 USDC per SOL. You think that SOL price will decrease from 130.90 USDC to 126.542983 within 2-3 days. You want to buy SOL as it gets cheaper.

    1. First, turn off auto-fill and add USDC only and set price range from minimum 126.542983 to maximum 130.90 USDC per SOL

    2. After, specifying the range select the volatile strategy you want for your position, here we used spot volatile strategy.

    3. Now, as the SOL price drops your USDC will be traded for SOL tokens. As the price reaches the minimum value you will be having all SOL tokens meaning all USDC (blue bars) tokens would have been traded out and your position would be left with only SOL (purple bars)

Multiple Positions:

  • Since there are a max of 69 bins available for each liquidity position. So, if you need to cover a wider price range than you need to open multiple positions. In case of volatile pairs you need to create more than one position to cover a wider price range.

Dynamic Fees:

Another reason the LPs should use the Meteora DLMM is that you have the option to earn Dynamic Fees on top of the base fees.

To counter Impermanent Loss, DLMM offers Dynamic fees that are designed to capture more value from market volatility.Dynamice Fees are designed to capture more value from market volatility. Fees increase during high market volatility to provide more returns for LPs with the given volume and decrease during low market volatility to encourage trading volume that generates fees.

Dynamic fee has 2 components — Base fee and Variable fee

  • Base Fee: The base fee of a market is configured by the pool creator and determined by the bin step (difference in basis points between 2 consecutive bins) and the base factor — which is the amplification to add to the bin step to allow for adjustment of the base fees.

  • Variable Fee: The variable fee depends on the volatility of the market, which is affected by swap frequencies as well as swaps that span across many bins. Fees are calculated and distributed on a per bin basis, allowing for a fair fee distribution to the LPs of each bin that is crossed.

How LP can benefit from this?

  • The DLMM helps to increase or decrease the fess depending on market volatility, dynamic fees also helps mitigating the impact of Impermannet loss. Dynamic fees are especially useful in the cases of high volatility trading pairs where overcoming Impermanent Loss has always been a challenge, especially without farming rewards.

DLMM Walkthrough

Now, I will be showing you how you can acess the Meteora DLMM, how you use the Meteora DLMM feature to provide liquidity and finally i will show you how to withdraw liquidity and close the position.

To access the Meteora DLMM follow the below steps:

  1. You can access the Meteora DLMM by visiting this url: https://app.meteora.ag/dlmm

  2. After visiting the url you will able to see all the availble pools.

    • The pools listed on this page are sorted by Volume.

    • From the screenshot you can see "24hr Fee/TVL" fees. Example: For JUP-SOL pool its showing about 0.82%, this is not your apr. This means is that this pool is earning 0.82% per day. Now, if you are trying to get an apr you need to multiply this with 365 and this would take you to around APR to be 299.3% and this is on average, there are LPs that are earning lot more than that

You can follow the below steps to provide liquidity to a pool:

For demonstration purposes I will be depositing liqudity in JUP-Bonk pool and in same way you can deposit liquidity in any pool.

  1. The very first step before depositing the liquidity is to determine the pool in which you want to deposit liquidity. In this case I am depositing liquidity in the USDC-USDT pool

  2. Now, click on the "USDC-USDT" pool and you will see something like thi

  3. Click on the "Add Liquidity button" and you will get something like thi

    • Now, you need to provide the amount you want to deposit for the liquidity. For example: I will be adding the assets in balanced proprotion.
  4. In this example, I am depositing a small capital as its a good practice to try with small capital if you are using new produc

    • From the region highlighted in red in the above screenshot we can see that upon entering the deposit amount how the liquidity is getting distributed in DLMM which is quite different when compared with other CLMMs and this is also a unique thing about Meteora DLMM that liquidity is organized in these zero slippage bins where each bin represents a price point and you can specify the depth of liquidity for each price point. The great part about this is that not only you can take benefit from zero slippage bin but also concentrate your liquidity by specifiying a tighter price range.
  5. Now, since we are providing liquidity across a stable pair there wont be much price volatility so we should use a narrow range instead of a wider range. The benefit of narrower range is that you will be having liquidity distributed across less bins and you will be able to earn more fees.

    • You can narrow down your range by changing the Min Price and Max price value or you can use the circle icon to narrow down the range by dragging the circle. I highlighted the circle inside green box in the above screenshot.
  6. After narrowing down the price range you will be seeing something like this:

    • Now, from the above screenshot we can see that we are having liquidity concentrated across a narrower price range and now we can earn more fees.

    • The gray area/bars you are seeing inside the yellow region in the above screenshot is these gray bars actually represents the pools, the distribution of the entire pool's liquidity, and you can also see that most of the people are using narrow range.

  7. After, narrowing down the range lastly you can also use another feature provided by DLMM is the volatility strategies. In this case i am using the curve strategy as the price of stables pairs doesnt fluctuate much and this strategy allows you to deploy you major capital at the current market price, hence you will be able to earn more fees.

    • You can choose any strategy from the three available strategies from the Meteora DLMM UI.
  8. Now, click on the "Add liquidity" button and your wallet will prompt for confirmation:

  9. After clicking on confirm you will be seeing something like this:

  10. Now, you can click on the position to kow details about it:

To withdraw liquidity from the pool:

  1. First, click on your liquidity position and you will see something like this:

  2. Now, click on "Withdraw" option and you will see something like this:

    • Specify the amount of liquidity you want withdraw

    • Next, you have two options:

      1. Withdraw Liquidity: This option will only withdraw the liqudity from the pool and doesn't claim the rewards

      2. Withdraw & Close Position: This option will withdraw the liquidity and also claim the rewards after closing the position.

  • Form the above screenshot we can see I am withdrawing all the liquidity from the pool.
  1. After, clicking on "Withdraw & Close Position" your wallet will prompt to confirm the transaction, click on confirm and your liquidity will be withdrawn and the position will be closed.

Conclusion:

Now, Liquidity Providers can maximize their profits by leveraging Meteroa DLMM key features and benefits. For the first time the LP's can counter the impermanent loss because of the Dynamic fees provided by Meteora DLMM. The DLMM also offers zero slippage bins and allows to choose any volatile strategies to maxmize earnings.

  • Using Meteora DLMM LPs can start earning even more. Meteora DLMM is even bring more oppurtunites for LPs so that they can recive even more rewards.

I hope this article has offered you a comprehensive walkthrough on Meteora DLMM, or has shed light on why becoming an LP on Meteora DLMM could be beneficial for you.

References: