DeliHook on Base

Uniswap v4 Hook Contract 0x570a48f96035c2874de1c0f13c5075a05683b0cc on Base · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$6.49K
All-time volume
$5.53M
Pools using this hook
54
Swaps (24h)
0 (0 traders)
Total swaps
78,317

What it does

Collects a swap fee in wBLT on every swap in pools that include wBLT and forwards it to a FeeProcessor contract, while also updating epoch and incentive gauge bookkeeping. Traders pay the fee on top of the swap, and LPs receive no part of it through the hook.

How it works step by step

  • Requires pools to pair wBLT with a non-native token and to use a dynamic LP fee; rejects other pools at initialization.
  • On initialization, sets the pool's dynamic fee from the tick spacing (supported spacings map to fees from 0.01% to 2.5%).
  • In beforeSwap, computes the fee in wBLT units, overrides the LP fee to 0 for the swap, and pre-credits the fee via a before-swap return delta when the fee token is the specified token.
  • In afterSwap, checks that the realized swap amount matches the intended amount, pokes the DailyEpochGauge and IncentiveGauge, takes the wBLT fee from the PoolManager to FeeProcessor, and calls FeeProcessor.collectFee.
  • Recognises internal buy-back swaps initiated by FeeProcessor (via a hookData flag and sender check) and tags them so FeeProcessor can account for them differently.
Swap behaviour
Every swap is handled by beforeSwap and afterSwap. The hook overrides the LP fee to 0 and charges its own fee in wBLT: pre-credited through the specified delta when the fee token is the specified token, or returned as an unspecified-side after-swap delta otherwise. The fee is then taken from the PoolManager and sent to FeeProcessor. afterSwap reverts with Slippage if the realized specified amount differs from the amount expected after the fee, which blocks partial fills.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The pool's swap fee is overridden to 0 for each swap. The hook charges its own fee in wBLT: on exact input it is ceil(amount * poolFee / 1e6), and on exact output it is ceil(amount * poolFee / (1e6 - poolFee)), where poolFee is the pool's stored dynamic fee. The fee is converted to wBLT units using the current sqrt price when needed and is sent to FeeProcessor. The owner can change poolFee per pool between 100 and 30,000 (0.01% to 3%).
Owner & admin controls
The owner (Ownable2Step, with renounceOwnership available) can set the FeeProcessor, DailyEpochGauge and IncentiveGauge addresses (each must be non-zero), and can set any initialized pool's dynamic fee within 0.01% to 3%. There is no pause function and no proxy or upgrade path found in the ABI or source. Parameters are changeable at any time without a timelock.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize enforces the token, dynamic-fee and component checks. afterInitialize initializes the gauges and sets the dynamic fee. beforeSwap sets the swap fee to 0 for the pool, computes the fee, and returns a specified delta that pre-credits the fee. afterSwap pokes the gauges, takes the fee to FeeProcessor, and returns an unspecified delta when the fee is not on the specified side. beforeSwapReturnDelta and afterSwapReturnDelta are enabled because the hook adjusts the swap's accounting and takes fee tokens.

Security & trust assessment

Risk level: medium (verified source, medium confidence).

Who controls it: A single owner key can change where all fees go, set the fee on each pool up to 3%, and substitute the gauge and fee processor contracts, which can block swaps or capture fees. Ownership transfer is two-step, which reduces the risk of accidental transfer, but there is no timelock on parameter changes.

Risk to user funds: The hook does not hold a token balance itself. On each swap it takes the wBLT fee from the PoolManager and transfers it to FeeProcessor, and it can pre-credit or return deltas that change what the swapper pays or receives. Swappers are exposed to the owner-set fee and to the fee processor address. Liquidity providers are not directly exposed to hook-held funds in the source provided.

Security findings

  • [high] Owner can redirect all collected fees: setFeeProcessor accepts any non-zero address, and every swap's wBLT fee is taken and sent to the current feeProcessor. A compromised or malicious owner could point it at an address they control and capture all future fees from every pool using this hook.
  • [high] Owner can halt swaps by replacing gauges or fee processor: afterSwap calls dailyEpochGauge.pokePool, incentiveGauge.pokePool and feeProcessor.collectFee without try/catch. Setting any of these to a contract that reverts, or to an address that is not a contract, makes every swap in the affected pools revert.
  • [medium] Owner can raise swap fee up to 3%: setPoolFee lets the owner set any pool's fee between 100 and 30,000 hundredths of a bip. Because the hook's fee calculation is based on this value, it directly sets the amount charged to traders on each swap, up to 3% of the swap amount.
  • [low] Partial fills revert: afterSwap requires the realized specified amount to equal the expected amount exactly, and reverts with Slippage otherwise. Swaps that would partially fill because of a price limit, or that hit edge cases in the fee rounding, will fail instead of executing partially.
  • [info] Dependence on unreviewed external contracts: FeeProcessor, DailyEpochGauge and IncentiveGauge were not included in the provided source. Their behaviour and trust assumptions cannot be assessed from this input, and they run inside every swap.

Contract details

Verified source
Yes (DeliHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
8,730 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc6909-claims, moves-currency, ownable, return-delta, rewards

Pools using DeliHook