About
Volatility-driven fee optimization for Uniswap V4 hooks using Pyth price data A Foundry-based project that integrates Pyth Network price feeds to calculate real-time volatility metrics for Uniswap V4 hook implementations. The system processes historical price data to generate a volatility index, enabling hooks to dynamically adjust trading fees based on market volatility patterns.
How it's made
Volatility-driven fee optimization for Uniswap V4 hooks using Pyth price data A Foundry-based project that integrates Pyth Network price feeds to calculate real-time volatility metrics for Uniswap V4 hook implementations. The architecture includes a VolatilityOracle contract that processes historical price data using logarithmic return calculations with 1e18 fixed-point precision, generating both per-second and annualized volatility metrics. A companion VolatilityFeeHook implements the Uniswap V4 hook interface with beforeSwap and afterSwap callbacks that query the oracle for current volatility levels. The hook applies a sigmoid-based fee adjustment curve: fee = baseFee * (1 + sigmoid(volatility - threshold) * maxAdjustment), ensuring smooth fee transitions and preventing extreme fee spikes while maintaining responsiveness to market volatility changes
From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.






