BoundedDynamicFeeHook
EthereumBoundedDynamicFeeHook is a Uniswap v4 hook on Ethereum. Brand new: its first pool went live today. Still in use: 1 trade in the last week, and 2 new pools this week.
- Contract name
- BoundedDynamicFeeHook
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(bytes32 id, bool zeroForOne) internal returns (uint24) { (, int24 tick) = _slot0(id); Oracle storage o = oracles[id]; Params memory p = _getParams(id); if (!o.init) { // first swap of the pool: start the average at the current price o.ema = int64(int256(tick) * PRECISION); o.init = true; } else { // The pool price has been `tick` since the previous swap, so the average moves toward it now. o.ema = _advance(o.ema, o.last, tick, p.window, uint32(block.timestamp)); } o.last = uint32(block.timestamp); bool firstInBlock = o.lastBlock != uint32(block.number); o.lastBlock = uint32(block.number); return _fee(id, p, tick, o.ema, zeroForOne, firstInBlock); }
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.