Thank you for Balancer Grants for funding this research.
Summary of Research Findings
Our team recently completed a comprehensive study on dynamic fee models for Balancer pools, focusing on maximizing revenue captured from CEX/DEX arbitrage opportunities. We analyzed various fee alternatives across 8 Balancer pools on Ethereum mainnet, Arbitrum, and Polygon, using historical data from August 2023 to June 2024.
Key findings include:
No one-size-fits-all solution: Optimal fee alternatives vary significantly across pools and networks.
Potential for improvement: 4 out of 8 studied pools could increase revenue while decreasing average fees using dynamic models.
Volume-based functions show promise: These consistently demonstrated potential for improvement across most pools.
Network differences: Shorter block times (e.g., on Arbitrum) resulted in fewer opportunities for fee optimization.
Gas price sensitivity: On Ethereum mainnet, gas price-based functions showed promising results for some pools.
Implications for Balancer
These findings open up exciting possibilities for enhancing Balancer pool efficiency:
Tailored Fee Structures: We can implement pool-specific fee models optimized for each pool’s unique characteristics and market conditions.
Increased Revenue: By adopting dynamic fee models or optimizing static fees, some pools could significantly increase revenue while maintaining or even lowering average fees.
Improved Competitiveness: More efficient fee structures could attract more liquidity and trading volume to Balancer pools.
Enhanced User Experience: Lower average fees in some pools could benefit traders and liquidity providers alike.
Future Research and Development Opportunities
Real-time Testing: Implement dynamic fee models in testnet environments to replicate findings in live market conditions.
Cross-chain Optimization: Further research into how different blockchain characteristics affect optimal fee structures.
Long-term Impact Study: Analyze how dynamic fees affect liquidity provision and trading behavior over extended periods. Lowering overall fees may lead to e.g., more solverschoosing the pool to fulfill swaps.
Governance Mechanism: Develop a system for decentralized governance of fee parameters.
CEX-DEX Arbitrage Estimation: Develop methods to estimate the portion of trading volume attributable to CEX-DEX arbitrage in each pool. This could provide valuable insights into:
The true impact of arbitrage on pool performance
How different market conditions affect arbitrage activity
The effectiveness of dynamic fee models in capturing value from arbitrage trades
Potential for creating more targeted fee strategies based on the level of arbitrage activity
Static Fee Optimization: Conduct a comprehensive analysis of current static fees across all Balancer pools to identify immediate opportunities for improvement.
Great job Santeri and Antero! This is the type of study that can have an immediate positive impact, kudos.
I’m curious about a couple of points. Let’s first refer to the WETH / BAL pool:
Why is the base fee tier not 1% (current pool fee percentage)? The only reason I could think of is that it was lower in the past for some of the blocks you considered and the average landed on 0.71%?
Why don’t the red, green and blue lines cross on a single point? With the current fee tier we should expect a 0% fee change. This is not the case, as the blue line crosses the base fee tier line (green dotted) at around a 10% fee change. This threw me off.
What static percentage would you recommend for the WETH / BAL pool? This is something that can and should be tried out based on your thorough research. We could then analyze the real impact of the change.
Regarding the volume based approach: would it be easy to build an off chain oracle for the ideal fee percentage based on volume (and really any off-chain data) that would inform a fee change on-chain made by governance (or a governance-delegated actor for simplicity)? How fast would the change have to be for results to still be meaningfully positive?
It would be interesting to see how different delays in fee change would affect the results. For example, if the fees are set daily based on the volume of the previous day, how well would this pool perform in terms of fees/APR? What about hourly? Every block?
We could study ways to make this change permissionless and automatic based on on-chain oracles or semi-trusted entities (this IMO is totally fine given changing fees within certain limits is not a power that can be abused). Probably too expensive for mainnet if too frequent, but for L2s it might be something cheap enough to pay off.
thank you for feedback. We are quite excited about the potential these results show. Your questions are addressed below:
(1. & 2.)
We compare our models to the historical average fee percentage of each block where the pool has a swap transaction. We’ll go through how the “base fee tier” has been calculated for each pool:
raw_data_balweth.ipynb fetches historical fee changes, block numbers, and log indices from pool contract’s SwapFeePercentageChanged events.
In the swaps_tvl / metric / metric_mainnet_swaps.sql table, we have all historical swaps matched with the exact swap fee used. fct_mainnet_fee_change.sql and fct_mainnet_swap.sql use a combination of the block number and log index of the event to set the fee changes and swaps in chronological order. This event id handles situations where there may be swaps with different fee tiers in a single block.
cast(concat(
lpad(block_number::text, 18, '0'),
lpad(log_index::text, 4, '0')
) as bigint) as id,
lvr / … / fct_mainnet_sim_swaps.sql calculates the per block average fee tier based on these historical swaps, as the models are also in block level granularity. These fee tiers are then used to calculate the theoretical CEX / DEX arbitrage (LVR) the same way as our fee functions.
These historical changes explain why the results with a static fee tier may differ from the historical baseline.
(3.)
Based on our models, we would recommend using a static swap fee of 0.5%. Longer explanation below:
The profitability of adjusting the swap fees depends on the actual arb volume and the relative arb volume compared to non-arb volume. This research doesn’t address the impact on non-arb returns so it would more safe to work with highly arbed pools.
We could assess the potential of adjusting the fee in two ways:
Assessing the current volume of arbitrage based on on-chain activity. Currently, a large portion of the WETH / BAL swap volume comes from addresses like this (link) that are arbing against CEX.
The theoretical potential and actual arb volume of WETH / BAL are quite high. Therefore we would recommend trying the fee percentage with the highest change in total fees.
Would love to get input from people with more experience in building oracles, but the modelling itself should be doable. Pick a fee function and multiplier / variable range for the pool based on the historical data set and run the LVR model for a rolling set of blocks. Then have it return the variable with the highest fees accumulated for the period. Especially for static fees, this should be quite simple as the effect on the actual fee percentage is known.
One factor to consider is that the model only considers blocks with a swap event. This could distort the results, especially with pools that have less activity.