Dynamic LP Fees
LP Fees vary based on real-time volatility
Overview
We have designed and implemented a novel "dynamic swap fee" mechanism that adjusts the swap fees LPs receive based on the real-time volatility of the underlying asset. The rationale is simple: higher volatility typically means greater potential impermanent loss for LPs, so to compensate them, swap fees rise as volatility increases and fall as it subsides. The swap fees are calculated dynamically based on real-time market volatility. The fees range from a base of 40 bps to a maximum of 150 bps during periods of high volatility and are adjusted every 1 min. Fees are automatically calculated and applied to each swap transaction.
The details below describe the analysis we did to design the fee mechanism, the overall design, the rationale for design, and the implementation results simulated historically.
The following shows the analysis and design for the BTC pool. The ETH pool works similarly.
1. Data Foundation and Volatility Calculation
We looked at 6 years of historical data (as of July 2025) at a frequency of 1 minute intervals, amounting to approximately 3.15 million minute-level observations
The volatility calculation employs a 60-minute rolling window approach. The last 60 minutes of price data (1-minute sampling) are used to calculate 1-minute log returns. The volatility calculated is the annualized 1-hour realized volatility (computed from 1-minute returns with a 60-minute rolling window):
annualized_volatility = log_returns.rolling(window=60).std() * sqrt(365 * 24 * 60)
Key Components:
Log Returns: Natural logarithm of price ratios for continuous compounding
Rolling Window: 60-minute (1-hour) lookback period
Annualization Factor: √(365 × 24 × 60) = √525,600 ≈ 724.68
This approach captures short-term volatility patterns while providing sufficient data points for statistical significance.
2. Volatility Distribution Analysis
The chart below shows the distribution of the hourly volatility over the last 6 years :

Minimum Volatility: 0.0217 (2.17% annualized)
Maximum Volatility: 13.9931 (1399.3% annualized)
Median: 0.40 (40% annualized)
Mean: 0.50 (50% annualized)
95th Percentile: 1.19 (119% annualized)
The volatility distribution exhibits:
Right-skewed distribution: Most observations cluster around low volatility levels
Heavy right tail: Occasional extreme volatility spikes during market stress
Concentration: Approximately 50% of observations below 40% annualized volatility
3. Fee Structure Design
The fee structure operates within defined bounds:
Minimum Fee: 0.004 (40 basis points)
Maximum Fee: 0.015 (150 basis points)
Transition Start: 0.40 (median volatility)
Transition End: 1.19 (95th percentile volatility)
Minimum swap fees of 40 bps apply for measured volatility levels of 40% and below. Maximum swap fees of 150 bps apply to measured volatility levels of 40% or higher. Between these ranges, swap fees are interpolated based on a smoothstep mapping function as detailed below:
def smooth_fee(volatility, min_fee, max_fee, v_min, v_max):
t = (volatility - v_min) / (v_max - v_min)
t = np.clip(t, 0, 1)
return min_fee + (max_fee - min_fee) * (3*t² - 2*t³)
This results in a fee mechanism with the following mathematical properties:
Smooth Transitions: First and second derivatives are continuous
Bounded Output: Fees constrained between min_fee and max_fee
Non-linear Mapping: Gentle acceleration in fee increases during moderate volatility
Plateau Behavior: Minimal fee changes at volatility extremes

Design Rationale
Lower Bound (v_min = 0.40):
Represents median market conditions
Ensures 50% of trading occurs at or near minimum fees
Provides competitive pricing during normal market conditions
Upper Bound (v_max = 1.19):
Captures 95% of historical volatility observations
Prevents excessive fee spikes during extreme events
Balances risk compensation with market accessibility
4. Implementation Results
We applied the fee design to the last 6 years of historical data. The chart below shows the distribution of hourly fee outcomes.

The implemented fee structure produces:
Median of fee distribution: 0.41% (41 basis points)
Mean of fee distribution: 0.58% (58 basis points)
95th Percentile Fee: 1.42% (142 basis points)
Fee Range: 0.40% - 1.50%
The charts below show the 1-hour and 1-day average fees in 2024 and 2025


This fee mechanism protects liquidity providers during volatile market conditions while offering competitive rates during stable periods, promoting efficient price discovery and fair value exchange.
Last updated
