AlphixLVRFee on Base
Uniswap v4 Hook Contract 0x7cbbff9c4fcd74b221c535f4fb4b1db04f1b9044 on Base · Dynamic fee · Verified contract
- Volume (24h)
- $3.02
- Value locked (TVL)
- $4.17
- All-time volume
- $1.93M
- Pools using this hook
- 2
- Swaps (24h)
- 13 (11 traders)
- Total swaps
- 79,432
What it does
A Uniswap v4 dynamic-fee hook that lets an authorized operator set each pool's LP fee and an optional protocol fee taken from swap output and sent to a treasury.
How it works step by step
- Sets each pool's LP fee dynamically through a restricted poke() call
- Optionally takes a per-pool hook fee from swap output as ERC-6909 claims, capped by MAX_HOOK_FEE
- Accumulates claims in the hook and forwards them to a treasury address via permissionless handleHookFees()
- Gates configuration (fees, treasury, pause, authority) behind OpenZeppelin AccessManaged roles
- Emits events for fee pokes, hook fee settings, hook fee captures and treasury changes
- Swap behaviour
- After each swap, the hook takes the configured hook fee (if any) from the output token as ERC-6909 claims, reducing the swapper's output by that amount via return delta; with the default zero hook fee it does nothing extra.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- LP fee is set per pool by a privileged poke() call (passed through BaseDynamicFee to the PoolManager). A separate per-pool hook fee, capped by MAX_HOOK_FEE and set via setHookFee, is taken from swap output as ERC-6909 claims; it is 0 (disabled) by default.
- Owner & admin controls
- AccessManaged: restricted functions (poke, setHookFee, setTreasury, pause, unpause, setAuthority) are gated by an OpenZeppelin AccessManager; whoever holds the relevant roles can set per-pool dynamic LP fees, set hook fee up to MAX_HOOK_FEE, redirect the treasury, and pause the hook. Pausing blocks poke, setHookFee and setTreasury; the owner can also change the authority.
Enabled Uniswap v4 callbacks
afterInitialize, afterSwap, afterSwapReturnDelta
afterInitialize validates the dynamic fee flag and sets the initial fee; afterSwap captures the hook fee from the swap output; afterSwapReturnDelta adjusts the swapper's output by the hook fee amount.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A restricted key can set any pool's LP fee via poke (including very high values that make swaps expensive), change the hook fee within the cap, redirect collected fees by changing the treasury, and pause all admin-gated operations. Authority can be reassigned, so control of the AccessManager determines control of the hook.
Risk to user funds: The hook takes a configurable share of swap output as ERC-6909 claims, so swappers receive less than the pool's raw output when the hook fee is non-zero. Claims are held by the hook until handleHookFees moves them to the treasury. The hook does not hold LP principal, but privileged roles can raise LP fees and redirect protocol fees.
Security findings
- [medium] Privileged dynamic fee setting: poke() sets the LP fee to any uint24 value gated only by the restricted modifier; a compromised or malicious role holder could set extreme fees on pools.
- [medium] Treasury redirection: setTreasury can redirect all accumulated hook fees (collected via handleHookFees to the treasury) to any address, with no timelock visible in the hook itself.
- [low] Pausable admin functions: The hook is pausable; while paused, admin functions revert, and the hook's own swap-path behavior depends on the implementation of pause semantics in the v4 callbacks.
- [low] Return-delta fee capture: The hook takes a fee from swap output via afterSwapReturnDelta and holds it as ERC-6909 claims until handleHookFees is called, which is permissionless and forwards balances to the treasury.
Contract details
- Verified source
- Yes (AlphixLVRFee)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 9,149 bytes
- Upgradeable proxy
- No
- Detected patterns
- auction, dynamic-fee, erc6909-claims, moves-currency, pausable, return-delta, self-unlock
Pools using AlphixLVRFee
- ETH / USDC (Dynamic fee) — 24h volume $3.02, TVL $3.06, 13 swaps today
- ETH / cbBTC (Dynamic fee) — 24h volume $0, TVL $1.11, 0 swaps today