Dynamic Fees

GAMMA Dynamic Fees Explained

The dynamic fee model and pool reblancing for our AMM was created by iterating on the numerous AMM designs throughout crypto over the years but adapted to the specific characteristics of a constant product system, which doesnโ€™t use discrete price bins. Instead, we use factors like price deviation, recent volatility, and liquidity concentration to compute the dynamic fee.

Dynamic Fee depends on

  1. How volatile the market is: If prices are fluctuating frequently, we increase the fee to protect the pool and generate more rewards for Liquidity Providers (LPs).

  2. How balanced the pool is: GAMMA aims for a 50/50 split of token amounts in the pool. The further away from that balance we get, the more we adjust the fee.

  3. Volume: If trading volume is high, fees can adapt to provide the optimum returns for LPs.


Dynamic Fee Formula

dynamic_fee_rate = base_fee + volatility_component + liquidity_imbalance_component
  • volatility_component

volatility_component = min(max_volatility_fee, volatility_factor * recent_price_volatility)
  • liquidity_imbalance_component

liquidity_imbalance_component = imbalance_factor * abs(current_ratio - ideal_ratio)

Liquidity imbalance is based on the deviation from the ideal token ratio (50/50). The further the pool moves away from this ratio, the higher the fee component becomes.

  • recent_price_volatility

recent_price_volatility = (max_price - min_price) / avg_price over the last N observations
  • current_ratio

current_ratio = token_0_amount / (token_0_amount + token_1_amount)

The current ratio of token amounts in the pool, compared against the ideal 50/50 split.

  • ideal_ratio

    For our AMM, the ideal ratio is set at 0.5, reflecting equal distribution between the two tokens.

Last updated