Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xa4e8ad8d697187125ee0f37ff46bc091e56520cc on Ethereum · Fee sharing

Volume (24h)
$34.94K
Value locked (TVL)
$1.35K
All-time volume
$34.94K
Pools using this hook
1
Swaps (24h)
169 (74 traders)
Total swaps
169

What it does

This hook charges traders a buy fee or a sell fee in basis points on top of the pool's LP fee, diverting part of each swap to a dev wallet, so trades in the more heavily charged direction pay more.

How it works step by step

  • Hook on a Uniswap v4 pool that charges a buy fee and a sell fee on swaps, expressed in basis points, and takes a cut of the trade through return deltas.
  • Exposes separate accounting counters for total buy fees, total sell fees, dev fees and pending dev fees, which suggests part of the collected fee is routed to a dev wallet.
  • Tracks a swap counter (totalSwaps) and a fixed LP fee constant, indicating the LP fee is kept separate from the hook fee.
  • Restricts initialization and callbacks to the pool manager through a caller check (CallerNotManager), and blocks donate and some liquidity callbacks (CallbackDisabled, NoTrade errors).
  • Exposes quoteFee(uint256,bool,bool) so front ends can preview the fee for a given amount and direction.
Swap behaviour
beforeSwap and afterSwap both run. Swaps are taken through the pool manager and the hook can adjust deltas, so buys and sells are charged different fees (BUY_FEE_BPS for one direction and SELL_FEE_BPS for the other); the exact direction-to-fee mapping could not be confirmed from bytecode alone.
Liquidity behaviour
beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity are present and appear to gate or observe liquidity changes; some of these paths may revert with CallbackDisabled, which would restrict liquidity operations.
Fee behaviour
Hook-level buy and sell fees in basis points (BUY_FEE_BPS, SELL_FEE_BPS) are taken on swaps and accumulated into dev fee accounting, on top of a fixed LP_FEE; the exact amounts and split percentages could not be confirmed from bytecode.
Owner & admin controls
A devWallet address is stored and pendingDevFees accumulates dev fees, so the dev wallet can presumably claim those fees; no owner setter or pause function appeared among the dispatched selectors, but the existence of a dev wallet and pending fee claim path suggests a privileged role. Fee parameters appear to be constants (BUY_FEE_BPS, SELL_FEE_BPS), so they may not be adjustable.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize validate pool setup; beforeSwap sets the dynamic fee and return delta for each swap; afterSwap records swap statistics and fee accounting and applies an after-swap return delta; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take currency from trades; beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity, afterRemoveLiquidity and beforeDonate are present for liquidity and donation gating or accounting.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: The dev wallet can claim accumulated dev fees; any upgrade or parameter mechanism could not be confirmed from the dispatched selectors.

Risk to user funds: The hook can take a portion of each swap through return deltas and holds accumulated fee balances for the dev wallet, so traders pay the hook fee on every trade.

Security findings

  • [medium] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the bytecode references take(address,address,uint256), so the hook can move pool currency to itself on every swap.
  • [info] Dev wallet receives fees: devWallet and pendingDevFees indicate a fixed recipient that accumulates fees; users pay this cut on every trade.
  • [low] Liquidity and donate callbacks may revert: CallbackDisabled and NoTrade errors appear in bytecode, so some liquidity or swap paths may be blocked by design.
  • [info] No source verification: Analysis is from decoded bytecode only, so exact fee math and access checks are inferred rather than confirmed.

Contract details

Verified source
No
Bytecode size
6,014 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta, rewards

Pools using Fee sharing hook