DeliHookConstantProduct on Base
Uniswap v4 Hook Contract 0x10f5d70061072709e4c0f6b3f0fd64b38e12bacc on Base · Custom pricing · 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
- 52
What it does
A Uniswap v4 hook that replaces concentrated liquidity with a full-range x*y=k pool for wBLT pairs, holding LP funds itself and forwarding a per-swap fee to an external FeeProcessor.
How it works step by step
- Implements x*y=k constant-product pricing over internally tracked reserves per pool, with full-range liquidity only.
- Requires one token of each pair to be wBLT and disallows native ETH; enforces tick spacing 1 and a minimum fee of 0.1%.
- Holds all LP deposits as ERC-6909 claims and tracks LP shares internally, with 1000 shares locked on first mint.
- Computes an implicit swap fee per trade and forwards it to FeeProcessor by burning hook claims and transferring underlying tokens.
- Pokes DailyEpochGauge and IncentiveGauge on user swaps and liquidity events to update reward accounting.
- Rejects liquidity additions and removals made directly through PoolManager, forcing them through the hook.
- Swap behaviour
- beforeSwap computes output with constant-product math using stored reserves and the pool fee, takes the input and settles the output as ERC-6909 claims, and returns a before-swap delta; afterSwap updates reserves, pokes gauges and forwards the fee to FeeProcessor.
- Liquidity behaviour
- Liquidity can only be added or removed through the hook's addLiquidity/removeLiquidity functions; direct PoolManager modifications revert. Deposits are converted into ERC-6909 claims held by the hook, and liquidity is tracked as fungible shares per pool with 1000 minimum shares locked on first mint. Pool reserves are full-range and stored internally.
- Fee behaviour
- Fee is a static pool fee (key.fee, minimum 0.1%) embedded in the constant-product formula; the implicit fee amount is computed per swap and forwarded to an external FeeProcessor by burning hook-held ERC-6909 claims and taking the underlying tokens, then notifying the FeeProcessor. Because the fee is removed from reserves, the constant product k decreases over time.
- Owner & admin controls
- Owner (Ownable2Step) can set feeProcessor, dailyEpochGauge, incentiveGauge and v2PositionHandler addresses; ownership transfer is two-step and renounceOwnership is available. No pause or upgrade mechanism is visible in the verified source. The owner cannot directly alter reserves or user balances.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize validates token pair and fee, emits PairCreated and marks the pool initialized; afterInitialize calls dailyEpochGauge.initPool; beforeAddLiquidity and beforeRemoveLiquidity revert to force liquidity through the hook; beforeSwap computes the constant-product swap and takes/settles ERC-6909 claims for the hook, returning a before-swap delta that replaces the pool's own AMM math; afterSwap updates reserves, pokes the daily epoch and incentive gauges, clears hook deltas and forwards the swap fee; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take over pricing and to adjust settled amounts.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can redirect fee flows and gauge accounting by pointing feeProcessor, dailyEpochGauge, incentiveGauge or v2PositionHandler to arbitrary contracts. A malicious or compromised owner could route fees or gauge notifications to a controlled contract, or set a gauge to a contract that reverts, which would block swaps (afterSwap calls the gauges and FeeProcessor without try/catch).
Risk to user funds: Liquidity providers deposit tokens that are held by the hook as ERC-6909 claims, and swaps are priced by the hook's own reserves, so the hook controls all pool funds. The owner cannot withdraw LP funds directly in the source shown, but can redirect fees and cause swap reverts via component addresses.
Security findings
- [medium] External component dependency can block swaps: Swap and liquidity paths call external dailyEpochGauge, incentiveGauge and feeProcessor contracts directly; if any of them revert, swaps and fee forwarding revert.
- [medium] Owner can repoint fee and gauge components: Setters allow the owner to swap in arbitrary gauge, fee processor and position handler contracts without timelock or event-restricted validation beyond a zero-address check.
- [low] Fees reduce pool reserves: The implicit fee is removed from reserves each swap, so k shrinks over time and LP share value depends on the external FeeProcessor's behaviour.
- [info] Hook custodies all pool liquidity: The hook holds the pool's liquidity as ERC-6909 claims and moves tokens to FeeProcessor on swaps, so it custodies all LP funds; a bug in the reserve or delta accounting could affect every pool it manages.
- [low] Custom curve arithmetic edge cases: _calculateImplicitFee and _getUnspecifiedAmount in exact-output mode can underflow or divide by zero in edge cases (for example reserveOut close to amountSpecified); the code guards some cases but reliance on unchecked external state warrants review.
Contract details
- Verified source
- Yes (DeliHookConstantProduct)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 21,062 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc6909-claims, moves-currency, ownable, return-delta, rewards, self-unlock
Pools using DeliHookConstantProduct
- wBLT / BMX (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today