Fee sharing hook on Base

Uniswap v4 Hook Contract 0xd6155ce86ff3a33f52493e08cf77d7bbdf21fffc on Base · Fee sharing

Volume (24h)
$60
Value locked (TVL)
$915
All-time volume
$60
Pools using this hook
1
Swaps (24h)
5 (5 traders)
Total swaps
5

What it does

This hook sets dynamic fees and risk parameters for pools that use vault-backed balances and an oracle, and it takes an operator fee share, though the exact effect on which trades pay more or less is not determinable from the decoded bytecode.

How it works step by step

  • Holds vault-backed pool balances and tracks per-pool funding, flow and oracle state through pool-keyed storage mappings
  • Sets dynamic LP fees and pool risk parameters (three uint16 risk values and bonus thresholds) via configurePool, setPoolRiskConfig and setPoolBonusThresholds
  • Runs before and after swap, liquidity and donate callbacks, with before-swap gating and after-swap accounting that updates pool state
  • Accrues operator fees per currency (operatorFeePips, operatorFeeAccruedByCurrency) and allows withdrawal through withdrawOperatorFees
  • Exposes a rewards controller and reward-enabled flag and supports trusted credit routers that can act on pools
  • Provides quote and preview functions (quoteExactInput, previewSwapFee, previewExecutionQuote) that suggest it prices swaps against an external oracle and vault balances
Swap behaviour
beforeSwap and afterSwap callbacks run, and beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take or give currency deltas on swaps; the exact fee or price direction is not determinable from the decoded bytecode.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity callbacks are enabled and update vault funding and balance storage (registerVaultFunding and related mappings).
Fee behaviour
Dynamic LP fee is set through updateDynamicLPFee and configurePool; an operator fee share is taken in pips (operatorFeePips) and accrued per currency, and fees are withdrawable by the operator.
Owner & admin controls
Owner-style setters exist for operator proposal and acceptance (proposeOperator, acceptOperator), pausing (setPaused), oracle keeper and staleness, rewards controller, trusted credit routers, pool configuration and risk parameters, operator fee pips and currency decimals; the decoded bytecode does not show whether these are gated by a timelock or multisig.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeDonate, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize seed pool configuration; beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity track vault funding; beforeSwap and afterSwap gate swaps and update accounting; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take currency deltas; beforeDonate and afterDonate are present for donation accounting.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: The operator, owner and oracle keeper roles can change fees, risk parameters, the oracle, the pause state and trusted credit routers, which could redirect value or halt trading.

Risk to user funds: The hook holds vault balances and can take currency through return deltas during swaps and liquidity changes, so user funds in affected pools are exposed to its logic and admin settings.

Security findings

  • [high] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the contract calls take(), so the hook can move user or pool currency during swaps.
  • [medium] Privileged pool parameter control: An operator or owner can change pool fees, risk configuration, bonus thresholds and decimals, and set trusted credit routers, which can alter trade outcomes for existing pools.
  • [medium] Pausable swaps and liquidity: setPaused and paused() indicate a pause switch that can block swaps or liquidity actions.
  • [medium] Oracle dependency: Pricing relies on an oracle keeper and staleness parameter; a stale or manipulated oracle could misprice swaps.
  • [low] Operator fee withdrawal: withdrawOperatorFees lets the operator withdraw accrued fees, so fee accounting depends on operator trust.

Contract details

Verified source
No
Bytecode size
24,214 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, fee-sharing, liquidity-management, moves-currency, oracle, pausable, return-delta, rewards

Pools using Fee sharing hook