Key Concepts

Understand the fundamental concepts of the DLMM protocol.

Bins

Bins are the core building blocks of DLMM. Each bin represents a discrete price level where liquidity can be deposited.

Key Properties

  • Discrete Prices: Each bin has one specific price

  • Fixed Width: Price increment determined by bin step

  • Liquidity Container: Holds reserves of both tokens

  • Zero Slippage: Trades within a bin have no price impact

Bin IDs

Every bin has a unique ID that determines its price.

ID System

  • Base ID: 8388608 represents price = 1.0

  • Lower IDs: Below 8388608 = price < 1.0

  • Higher IDs: Above 8388608 = price > 1.0

ID to Price Formula

price = (1 + binStep/10000) ^ (binId - 8388608)

Examples

Bin Steps

The bin step defines the price increment between adjacent bins.

Common Bin Steps

Bin Step
Percentage
Use Case

1

0.01%

Stablecoins

5

0.05%

Low volatility

10

0.10%

Medium volatility

20

0.20%

Medium volatility

50

0.50%

High volatility

100

1.00%

very high volatility

200

2.00%

very high volatility

500

5.00%

very high volatility

Bin Step Impact

Active Bin

The active bin is where the current market price resides.

Properties

  • Current Trading Price: All swaps start here

  • Mixed Reserves: Contains both tokens

  • Price Discovery: Moves as liquidity is consumed

Active Bin Behavior

Bin Transitions

When active bin liquidity is exhausted:

  1. Buy (X→Y): Active bin moves up (higher ID)

  2. Sell (Y→X): Active bin moves down (lower ID)

Price Calculation

Price from Bin ID

Bin ID from Price

Price Impact

Practical Example

Key Takeaways

  1. Bins = Price Levels: Each bin is a discrete price point

  2. Bin ID = Price: Higher ID means higher price

  3. Bin Step = Precision: Smaller steps mean finer price control

  4. Active Bin = Market: Current trading happens here

  5. No Continuous Prices: Everything is discretized

Next Steps

Now that you understand the concepts:

Last updated