Dynamic fee Uniswap v4 Hook using cross-chain Chainlink volatility data via LayerZero
This project implements a Uniswap v4 hook that dynamically adjusts trading fees based on real-time volatility data sourced from multiple blockchains. By leveraging Chainlink's price feeds on Arbitrum and transmitting this data via LayerZero's cross-chain messaging protocol, the hook creates a more responsive and risk-adjusted fee structure for liquidity providers.
Traditional Uniswap pools use static fees that don't account for market conditions. During high volatility periods, liquidity providers face increased impermanent loss risk but receive the same compensation. This hook solves this by automatically scaling fees from low during stable periods to higher during high volatility, ensuring LPs are fairly compensated for risk while maintaining competitive pricing during calm markets.
Technical Architecture: The system consists of three core components: a data ingestion contract on Arbitrum that reads Chainlink's ETH-USD 30-Day Realized Vol metric, a LayerZero bridge integration that securely transmits volatility data across chains with minimal latency, and a Uniswap v4 hook contract that receives cross-chain volatility updates and implements dynamic fee adjustments in the beforeSwap function. The front-end displays the volatility data in a pleasing graphical format.