Skip to main content

Dynamic Fee

Besides the programmable pricing curve model, we also introduce a dynamic LP fee model that adjusts the AMM LP fee based on market conditions. Most existing AMMs have a simple LP fee model (e.g. a fixed percentage of the trade value). This does not reflect what is happening in traditional capital markets, in which market makers adjust the trading spread based on market conditions to either protect themselves (when market is fast-moving) or attract more trades to incentivize more trades.

We wanted to bring this important fee/market volatility correlation to AMMs.

Particularly, in our dynamic fee model, the LP fee is increased when the market is moving fast (i.e. becoming volatile), and is reduced when the market is stable (less volatile). In a 'quiet' market, the dynamic fee model encourages the user to trade more by offering tighter spreads through the reduction of LP fees. The increased volume attracted by the lower spread will arguably make up for the revenue loss due to the reduction of the LP fees. On the other hand, spreads are increased by charging higher LP fees when the market is volatile. Traders or users who trade in such volatile markets will receive fewer tokens than average, as the profit is kept in the pool to reduce potential impermanent loss for LPs. Thus, this dynamic fee model encourages market stability in Defi through spread adjustments.

There are several ways to implement this dynamic fee adjustment mechanism deterministically. The DMM's approach is based on the on-chain volume of each pool. To determine the fluctuation of the DMMโ€™s volume, the AMM compares its volume between the short window and long window using methodologies such as Simple Moving Average (SMA) or Exponential Moving Average (EMA).

Dynamic Fee Adjustment based on Volume#

Based on this bonding function, when users want to sell ฮ”x\Delta x, the formula for ฮ”y\Delta y they get in the Dynamic Fee model is:

ฮ”y=f(x)โˆ’f(x+ฮ”xโ‹…(1โˆ’feeโˆ’z))\Delta y = f(x) - f(x + \Delta x \cdot (1 - fee - z))

where:

  • x,yx, y are the current inventories of 2 assets X,YX, Y
  • feefee is the base fee, pre-defined by AMM
  • zz is the variant factor, dependent on the average volume of AMM during a time period. It must satisfy the condition 0<1โˆ’feeโˆ’zโ‰ค10 < 1 โˆ’ fee โˆ’ z \leq 1, alternatively written as โˆ’feeโ‰คz<1โˆ’feeโˆ’fee \leq z < 1 โˆ’ fee