Fee sharing hook on Ethereum
Uniswap v4 Hook Contract 0xb726548e355a7434f6d8b130e6a34e2fa55e20cc on Ethereum · Fee sharing
- Volume (24h)
- $1.63K
- Value locked (TVL)
- $3.17K
- All-time volume
- $1.63K
- Pools using this hook
- 1
- Swaps (24h)
- 11 (5 traders)
- Total swaps
- 11
What it does
This hook skims a portion of swap value through return deltas into fee counters that are periodically flushed to a treasury, so swappers pay the hook's cut on each trade; the exact fee rates and which trade directions pay more could not be confirmed from the bytecode.
How it works step by step
- Hook is initialized with a pool key and records the pool id, tick spacing and an initializer address in beforeInitialize
- Takes a share of pool activity into a treasury: totalFees, pendingFees and totalFlushed counters suggest accumulated fees are periodically flushed
- flush() is rate-limited by MIN_FLUSH_INTERVAL and nextFlushAt, with a FlushTooSoon error, and sends accumulated value to treasury, with a reserve cap (RESERVE_CAP_BPS) and a vault share (VAULT_BPS)
- Enforces a per-swap impact cap (MAX_IMPACT_BPS) and a minimum buy amount (MIN_BUY_ETH) in beforeSwap, with a previewBuy view
- Uses return deltas in beforeSwap and afterSwap to take a portion of swap amounts, and calls the pool manager's take and unlock functions for settlement
- Swap behaviour
- beforeSwap checks swap size against impact and minimum buy limits and can alter the swap through return deltas; afterSwap accounts fees from the swap. Exact direction-dependent pricing cannot be confirmed from the decoded bytecode.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity are present as selectors and afterAddLiquidity/afterRemoveLiquidity exist, but the hook does not enable those permissions, so the callbacks are not invoked by the pool manager.
- Fee behaviour
- Fees are taken as a return delta from swaps and accumulated into pending and total fee counters, then split between a reserve and a vault/treasury share on flush. The LP fee constant is exposed as LP_FEE; the exact percentages cannot be determined from decoded bytecode.
- Owner & admin controls
- Ownable with owner, pendingOwner, transferOwnership, acceptOwnership and renounceOwnership; the owner can set the treasury address via setTreasury. No pause function was identified.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize records pool configuration; beforeSwap enforces limits and takes a return delta on swaps; afterSwap accounts fees and takes an afterSwap return delta.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner controls the treasury destination and ownership transfer; no timelock or pause was identified from the bytecode.
Risk to user funds: The hook can take currency from swaps via return deltas and holds accumulated fees until flushed, so traders pay the hook's cut and funds sit in the hook between flushes.
Security findings
- [medium] Owner can redirect fees: setTreasury lets the owner change the address that receives flushed fees, so a compromised owner key could redirect accumulated value.
- [medium] Return-delta fee capture: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook takes a share of swap currency before settlement, which is a direct cut of trader flow.
- [info] Hook holds pool funds: The contract accumulates fee balances and can hold ETH (heldEth), so user-related value is custodied until flush.
- [info] Pool-manager unlock callback: unlockCallback and self-unlock logic mean the hook opens pool manager sessions to move currency, which requires correct caller checks to be secure.
Contract details
- Verified source
- No
- Bytecode size
- 9,993 bytes
- Upgradeable proxy
- No
- Detected patterns
- liquidity-management, moves-currency, ownable, return-delta, self-unlock
Pools using Fee sharing hook
- ETH / OG (1.00% fee) — 24h volume $1.63K, TVL $3.17K, 11 swaps today