๐ฃ Dynamic Fee
Chiss employs a dynamic fee function to protect liquidity providers during high imbalance or volatility for FX Swaps. The fee increases non-linearly as:
- The pool reserve ratio deviates from oracle-referenced parity.
- Oracle price variance exceeds a configured threshold.
The fee is computed from a balance ratio, derived from the harmonic and arithmetic means of virtual token balances, Xv and Yv.
At the core, the Fee Increase due to Imbalance is caused by the feeMultiplier calculated as a function of the Balance Ratio. The Balance Ratio expressed mathematically is,
Let Harmonic mean, H be
Let Arithmetic mean, A, be
i.e. Balance Ratio
With the Dynamic Fee =
The following can be derived from the above formula.
balanceRatio = 1 โ dynamicFee = baseFee
balanceRatio = 0 โ dynamicFee = feeMultiplier ร baseFee
Simply put, the more imbalanced the pool becomes i.e. Xv โซ Yv or vice versa, the smaller the balanceRatio becomes. When Xv โ Yv, balanceRatio โ 1, so dynamic fee โ baseFee. When high imbalance i.e Xv โซ Yv, balanceRatio approaches 0, so fee grows toward feeMultiplier ร baseFee.
The feeMultiplier defines the maximum multiplier of the base fee during extreme imbalance. It controls how aggressively fee increases with imbalance and defines the max multiple of the base fee when the pool is imbalanced.
This fee is redistributed to Liquidity providers and a portion injected into the protocol reserve, depending on DAO parameters.