Fee Structure

Understanding DLMM's dynamic fee mechanism

Total Swap Fee

Each swap pays a total fee composed of two parts:

f_s = f_b + f_v

Base Fee (f_b)

The base fee is configured by the pool creator and is proportional to the bin step and a base factor. It represents the minimum fee floor that LPs will always earn, regardless of market conditions.

  • Set at pool creation
  • Proportional to bin step size
  • Provides predictable minimum yield for LPs

Variable Fee (f_v)

The variable fee rises with volatility and with how many bins a swap crosses. For a multi-bin swap, fees are computed per bin as the trade walks bins. The formula is:

f_v(k) = A · (v_a(k) · s)²

Where:

  • A: Control parameter that scales the fee response
  • v_a(k): Volatility accumulator for the k-th bin
  • s: Bin step size

Key Parameters

Bin Step (s)

Price granularity measured in basis points (bps). Determines the fixed percentage distance between adjacent bins.

Base Factor (B)

Shapes the base fee calculation along with base_fee_power_factor.

Variable Fee Control (A)

Governs volatility measurement and surge fees. Higher values mean more aggressive fee increases during volatile periods.

Filter Period (t_f) & Decay Period (t_d)

Time-based parameters that control how quickly the volatility reference responds to and decays from market activity.

Fee Distribution

Fees are tracked per bin and distributed to LPs in those bins. Only bins that become active during swaps earn fees. This creates a natural incentive for LPs to position their liquidity where trading activity is most likely to occur.