DeliHookConstantProduct on Base

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

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

What it does

Constant-product (x*y=k) AMM hook for wBLT pairs that replaces Uniswap V4 concentrated liquidity, keeps liquidity as full-range shares, and forwards the implicit swap fee to a FeeProcessor.

How it works step by step

  • Implements x*y=k constant-product pricing per pool, overriding the PoolManager's concentrated curve.
  • Requires one side of every pool to be wBLT and enforces tickSpacing 1, fixed initial price and at least 0.1% fee.
  • Accepts liquidity only through addLiquidity and removeLiquidity, minting and burning per-user shares with 1000 locked minimum liquidity.
  • Takes the implicit swap fee, burns it from ERC-6909 balances and transfers it to the FeeProcessor on each swap.
  • Checkpoints DailyEpochGauge and IncentiveGauge on each swap and notifies the V2PositionHandler on liquidity changes.
Swap behaviour
Every swap is priced with x*y=k reserves (fee-inclusive output for exact input; input computed against gross output when fee is taken from output for exact output). The hook takes the specified amount and settles the unspecified amount through ERC-6909 balances, updates reserves in afterSwap, enforces a virtual price limit and forwards the fee to the FeeProcessor.
Liquidity behaviour
Liquidity can only be added or removed through the hook's addLiquidity and removeLiquidity functions; direct PoolManager liquidity calls revert. Positions are full-range constant-product shares tracked per user, with 1000 minimum liquidity locked on the first mint. Each add or remove notifies the V2PositionHandler and updates gauge checkpoints.
Fee behaviour
Swap fee is taken implicitly from the constant-product math on each swap (fee in input or output depending on whether wBLT is the output). The fee amount is burned from the hook's ERC-6909 balance, taken as real tokens and forwarded to the FeeProcessor contract, which then decides how it is used; it is not paid to LPs through reserves. Pool fee must be at least 1000 hundredths of a basis point.
Owner & admin controls
Owner (Ownable2Step) can set feeProcessor, dailyEpochGauge, incentiveGauge and v2PositionHandler addresses, and can transfer or renounce ownership. Setters only accept non-zero addresses; there is no pause, no upgrade proxy and no fee-rate setter in the hook itself. The pool fee is fixed at pool creation and only needs to be at least 0.1%.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta

beforeInitialize validates the pool (no native ETH, wBLT must be one side, tickSpacing 1, fixed sqrtPrice 2^96, fee at least 0.1%) and emits PairCreated. afterInitialize seeds the DailyEpochGauge and IncentiveGauge pool state. beforeAddLiquidity and beforeRemoveLiquidity revert to force liquidity through the hook. beforeSwap replaces the PoolManager curve with x*y=k math and returns a delta, taking the specified input and settling the calculated output via ERC-6909 balances. afterSwap updates reserves, enforces a virtual price limit, pokes gauges and forwards the fee to the FeeProcessor. beforeSwapReturnDelta is enabled because the hook overrides the swap amounts.

Security & trust assessment

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

Who controls it: The owner cannot directly seize user funds or change the fee rate, but can redirect all swap fees by pointing feeProcessor to a malicious contract, and can swap out the gauge or position-handler contracts to break reward accounting or block position updates. Setters accept any non-zero address without validation.

Risk to user funds: The hook holds pool reserves as ERC-6909 claims and moves fee tokens to the FeeProcessor during swaps. It cannot withdraw LP principal to the owner directly, but the owner can redirect fees and replace dependency contracts that gate swaps and liquidity operations.

Security findings

  • [high] Owner can redirect swap fees: Owner can call setFeeProcessor to route all collected swap fees to an arbitrary contract, with no timelock or cap.
  • [medium] Owner can brick pool operations by swapping dependencies: setDailyEpochGauge, setIncentiveGauge and setV2PositionHandler replace external dependencies with no validation; a bad address can revert every swap, add or remove liquidity call (afterSwap pokes gauges and liquidity calls notify the handler).
  • [medium] Hook holds pool token balances: The hook takes real tokens via ERC-6909 burns and fee transfers, and holds ERC-6909 balances on behalf of LPs; a compromised owner or a faulty FeeProcessor could affect pool reserves.
  • [info] Price-limit reverts: Swaps revert if the virtual V2 price crosses sqrtPriceLimitX96 after the trade, which can cause reverts for users who set limits.
  • [info] Two-step ownership: Ownership uses Ownable2Step, so transfers require acceptance by the new owner, reducing accidental transfer risk.

Contract details

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

Pools using DeliHookConstantProduct