Dynamic fee hook on Base
Uniswap v4 Hook Contract 0x0c1d0f3375001a43a543109c65a221b77d558088 on Base · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook sets a per-pool dynamic fee on swaps that the owner can adjust up to a cap, so traders on configured pools pay the owner-set fee while LPs earn the remainder.
How it works step by step
- Stores a per-pool fee value set by the owner through setFee(bytes32,uint16), capped by MAX_FEE_BPS.
- Uses beforeSwap to apply a fee via the return delta so the hook can take a cut of the swap amount.
- Interacts with the Uniswap v4 PoolManager (poolManager() getter) and appears to be tied to an external OMM-style swap callback (metricOmmSwapCallback).
- Stores pool configuration in a mapping keyed by pool id, read during swaps and written during pool registration (selector 0x91b37a93).
- Swap behaviour
- beforeSwap is called before each swap, reads the pool configuration and returns a delta adjustment; the exact direction and size of the adjustment cannot be fully determined from decoded bytecode, so which trades pay more or less is not established.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Fee is set per pool by the owner via setFee and bounded by MAX_FEE_BPS; the fee is applied through the beforeSwap return delta rather than the pool's static fee.
- Owner & admin controls
- Owner (address in slot 0) can call setFee to change pool fees, transferOwnership to hand over control, and the registration function 0x91b37a93 is callable as non-view. Ownership is a single address with no timelock evident in the bytecode.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap is used to compute and apply a fee-related delta on each swap; beforeSwapReturnDelta allows that delta to alter the swap amounts.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can raise the fee up to MAX_FEE_BPS on any configured pool and can transfer ownership to any address, effectively controlling trader costs and fee revenue.
Risk to user funds: The hook can take a fee from swap flows via return deltas, so it touches user swap amounts, but it is not evident that it can custody or freeze pool principal.
Security findings
- [medium] Owner can set swap fee: setFee(bytes32,uint16) is callable by the owner and changes the fee applied via beforeSwap return delta, bounded only by MAX_FEE_BPS; a high fee would make swaps costly for users.
- [medium] Return delta modifies swap amounts: beforeSwapReturnDelta permission lets the hook take tokens from swaps through the delta, so the hook can hold or capture a portion of user trade flow.
- [info] Single-owner control: Owner is stored in slot 0 and can transfer ownership at will with no evident timelock or multisig requirement.
- [low] Pool registration is not owner-gated in decoded view: Selector 0x91b37a93 writes the pool mapping in slot 1 and is non-view; whether it is restricted to the owner or PoolManager cannot be confirmed from decoded bytecode alone.
Contract details
- Verified source
- No
- Bytecode size
- 5,933 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, ownable, return-delta
Pools using Dynamic fee hook
- USDC / AMZNc (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDC / GOOGLc (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today