DeliHookConstantProduct on Base
Uniswap v4 Hook Contract 0x00c9da9abc5303219ead3cf0307b5a8a7644bac8 on Base · Custom pricing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 10
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 10
What it does
A constant-product (x*y=k) pool hook for wBLT pairs on Base that routes all liquidity through itself, charges a fixed fee and forwards the fee in wBLT to an owner-set fee processor.
How it works step by step
- Implements a constant-product AMM with reserves tracked inside the hook rather than in PoolManager concentrated liquidity.
- Requires one leg of each pool to be wBLT and forbids native ETH; pools must use tick spacing 1 and a 1:1 starting price.
- Charges a fee (min 0.1%) either from input or output, removes it from reserves and sends it as wBLT to feeProcessor on each swap.
- Mints and burns internal liquidity shares for LPs on addLiquidity and removeLiquidity, with 1000 shares locked on first deposit.
- Blocks direct PoolManager liquidity modifications so all liquidity must flow through the hook.
- Bootstraps and updates DailyEpochGauge and IncentiveGauge pool state and notifies a V2PositionHandler on liquidity changes.
- Swap behaviour
- beforeSwap replaces the standard AMM with constant-product math over the hook's stored reserves, settles tokens via ERC-6909 claims and returns custom deltas; afterSwap updates reserves, enforces a virtual price limit, pokes the gauges and forwards the fee to feeProcessor. Swaps revert if the price would cross the sqrtPriceLimit.
- Liquidity behaviour
- Liquidity is added and removed only through addLiquidity and removeLiquidity on the hook, which mint and burn internal liquidity shares and ERC-6909 claims. Direct PoolManager liquidity modification reverts (LiquidityOnlyViaHook). Positions are always full-range constant product with reserves tracked in the hook; a first deposit locks 1000 shares.
- Fee behaviour
- Pools use a fixed fee set at initialization (minimum 0.1%, enforced in beforeInitialize). The implicit fee is removed from reserves and forwarded in wBLT to feeProcessor via burn and take on every swap; the fee is not sent to LPs as fee growth. beforeSwapReturnDelta lets the hook settle the specified and unspecified amounts itself.
- Owner & admin controls
- Owner (Ownable2Step, two-step transfer) can set feeProcessor, dailyEpochGauge, incentiveGauge and v2PositionHandler addresses; each setter only rejects zero addresses, so the owner can repoint the fee destination and gauge/handler contracts at any time. Owner can renounce ownership. No pause or upgrade mechanism found; the hook is not a proxy.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta
beforeInitialize: validates pair includes wBLT, tick spacing 1, sqrtPrice fixed at 1:1, fee at least 0.1%, and gauge/handler components set, then marks pool initialized. afterInitialize: bootstraps DailyEpochGauge and IncentiveGauge pool state. beforeAddLiquidity and beforeRemoveLiquidity: revert to force liquidity through the hook. beforeSwap: replaces the AMM with constant product math and takes/settles tokens via ERC-6909 claims. afterSwap: updates reserves, enforces a virtual price limit, pokes gauges and forwards the fee to feeProcessor. beforeSwapReturnDelta: lets the hook override the swap's token deltas.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can redirect all swap fees by pointing feeProcessor at any contract, and can swap out the gauge and position-handler contracts, which are called on every swap, liquidity change and pool init. A malicious or compromised owner could make swaps or liquidity operations revert by setting a faulty component, or siphon fees through a rogue feeProcessor. Ownership is two-step, but the key is a single EOA or multisig with no timelock.
Risk to user funds: The hook holds all pool reserves as ERC-6909 claims and controls swap settlement via return deltas, so user funds depend on the correctness of its custom accounting. The owner cannot directly withdraw LP funds from the code shown, but can redirect fees and replace the gauge and handler dependencies that run on every operation.
Security findings
- [medium] Owner-controlled fee destination: afterSwap forwards fees to feeProcessor, a mutable address set by the owner. Swap fees can be redirected to any address the owner chooses.
- [medium] Swappable external dependencies can halt or hijack operations: dailyEpochGauge, incentiveGauge and v2PositionHandler are external calls made during swaps and liquidity changes, and all can be replaced by the owner. A faulty or malicious replacement can revert every swap or liquidity action.
- [medium] Hook custodies pooled funds and sets return deltas: The hook holds the pool's reserve tokens as ERC-6909 claims and settles swaps itself via beforeSwapReturnDelta, so user liquidity and swap value are custodied by this contract. Reserve accounting is internal and not reconciled with on-chain balances beyond the poolManager.
- [low] No timelock or validation on admin setters: Each setter rejects only zero addresses, with no interface validation, timelock or event-gated delay beyond the emitted update event.
- [low] Custom accounting relies on internally tracked reserves: Swap pricing uses reserves that are updated from computed deltas rather than actual token balances, and the constant-product formulas are hand-written. Mismatches could leave reserves out of sync with held claims.
Contract details
- Verified source
- Yes (DeliHookConstantProduct)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 23,943 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
- wBLT / USDC (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (0.40% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (0.15% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / CDX (2.50% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (0.65% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (2.50% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (1.75% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (1.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- wBLT / USDC (0.10% fee) — 24h volume $0, TVL $0, 0 swaps today