BID-ASK Distribution

Create weighted liquidity that increases farther from the current price. Ideal for market making and volatility harvesting strategies. Visit the Shapes and Strategy section for more details.

Quick Implementation

import { DistributionUtils } from '@ferra-labs/dlmm';

// Create BID-ASK distribution
const bidAskParams = DistributionUtils.createParams(
  DistributionUtils.BID_ASK,
  {
    activeId: pair.parameters.active_id,
    binRange: [activeId - 15, activeId + 15],
    parsedAmounts: [
      new Decimal(1000),  // token X
      new Decimal(1000)   // token Y
    ]
  }
);

// Add liquidity
const tx = await sdk.Pair.openPositionAndAddLiquidity(pair, {
  amountX: 1000000000n,
  amountY: 1000000000n,
  ...bidAskParams
});

How It Works

Liquidity weight increases with distance from active bin:

  • Bin ±1: Weight = 2

  • Bin ±2: Weight = 3

  • Bin ±3: Weight = 4

  • And so on...

Best Use Cases

Ideal for:

  • Market making strategies

  • Mean reversion trading

  • Volatility harvesting

  • Large price swings

Not suitable for:

  • Stable pairs

  • Trending markets

  • Passive strategies

Strategy Benefits

Volatility Capture

  • Profits from price swings

  • Better fills at extremes

  • Natural buy low/sell high

Risk Management

  • Less IL at current price

  • Protected from small moves

  • Captures large deviations

Configuration Tips

  • Volatile pairs: 20-30 bin range

  • Standard pairs: 15-20 bin range

  • Adjust range: Based on historical volatility

Example Scenarios

Key Advantages

  • Captures volatility premium

  • Reduces impermanent loss risk

  • Better pricing at extremes

  • Automated mean reversion

Last updated