DynamicFeeHook
EthereumDynamicFeeHook is a Uniswap v4 hook on Ethereum. Brand new: its first pool went live today. Still in use: 3 trades in the last week, and 1 new pool this week.
- Contract name
- DynamicFeeHook
How this hook works
Smart feesA smart fees hook. It changes its fee with the market.
Fee changes with the market
Instead of a fixed fee, it works out the fee on every trade from how the price is moving. The fee goes to liquidity providers; the hook keeps nothing for itself.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external onlyPoolManager returns (bytes4, int256, uint24) { bytes32 id = poolId(key); (, int24 tick) = _slot0(id); Oracle storage o = oracles[id]; if (!o.init) { // first swap of the pool: start the average at the current price o.ema = int64(int256(tick) * PRECISION); o.last = uint32(block.timestamp); o.init = true; } uint24 fee = _fee(id, _getParams(id), tick, o.ema, params.zeroForOne, o.lastBlock != uint32(block.number)); return (this.beforeSwap.selector, int256(0), fee | OVERRIDE_FEE_FLAG); }
Who controls it: The hook developer can change: params, venue. The hook developer can also call: clear venue. The code cannot be changed.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditsetParamsWhat it can do
Its code executes inside each trade in pools that use it.
Pools using it let the hook choose the swap fee instead of a fixed tier.
Hook history
Nothing recorded yet.
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.