Custom pricing hook on Ethereum
Uniswap v4 Hook Contract 0x09a349518824d1cad69fcf1102f45c237967658b on Ethereum · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $0.03
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 2 (2 traders)
- Total swaps
- 2
What it does
This hook takes over liquidity and swap accounting for the pool, adjusting swap amounts and fees through return deltas, though how fees are split between traders and LPs cannot be confirmed without source.
How it works step by step
- Takes over liquidity accounting for pool positions via afterAddLiquidity and afterRemoveLiquidity return deltas, mapping position keys to internal debt-like balances in a nested mapping
- Uses beforeSwap with return delta to adjust swap amounts, and takes or settles currency through an external take(address,address,uint256) call on the pool manager
- Sets a dynamic fee through the beforeSwap path, indicated by the dynamic-fee heuristic and the fee-related state read in beforeSwap
- Records a fee receiver address and a per-pool uint16 parameter that is written by owner-gated functions
- Includes pancakeV3SwapCallback and uniswapV3SwapCallback handlers, suggesting it performs internal swaps against an external pool to rebalance or convert currency
- Exposes a payable entry point (0xb8216c95) that reads and writes accounting state and fee receiver, which may be used to deposit or claim funds
- Swap behaviour
- beforeSwap runs on every swap, can return a delta that changes the swap amounts, and may take or settle currency through the pool manager; the exact pricing or fee direction cannot be determined from the decoded bytecode alone.
- Liquidity behaviour
- afterAddLiquidity and afterRemoveLiquidity run after position changes, return deltas that alter the amounts settled, and update per-position accounting in a nested mapping keyed by a uint256 and address.
- Fee behaviour
- Sets a dynamic fee via the beforeSwap path; the fee value, its calculation and its split between LPs and feeReceiver cannot be confirmed without source.
- Owner & admin controls
- Owner (ownable) can transfer or renounce ownership and set the fee receiver address; owner-gated writes to uint16 parameters also exist, though the exact parameters are unknown.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, beforeSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
beforeInitialize sets up per-pool state on pool creation; beforeSwap adjusts swap deltas and fees; beforeSwapReturnDelta, afterAddLiquidityReturnDelta and afterRemoveLiquidityReturnDelta let the hook alter the amounts settled with the pool; afterAddLiquidity and afterRemoveLiquidity update accounting after liquidity changes.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A single owner key can change the fee receiver and a uint16 parameter, and can transfer or renounce ownership; a compromised key could redirect fee flows or change parameters that affect swap pricing.
Risk to user funds: The hook can take currency via the pool manager and changes swap and liquidity amounts through return deltas, so it can hold or redirect pool and user funds depending on its accounting logic.
Security findings
- [high] Return deltas can move pool funds: Multiple return-delta permissions let the hook change amounts settled on swaps and liquidity changes, and the hook calls take to move currency out of the pool manager.
- [medium] Owner-controlled parameters and fee receiver: The owner can change a uint16 parameter and set feeReceiver, which can redirect fees or alter swap economics if the parameter controls the fee.
- [info] Ownership can be renounced or transferred: transferOwnership and renounceOwnership are present, so control of the hook can be handed to another key or permanently removed.
- [medium] Unverified source: No verified source is available, so the exact fee math and accounting logic could not be audited.
Contract details
- Verified source
- No
- Bytecode size
- 12,917 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using Custom pricing hook
- ETH / USDC (0.00% fee) — 24h volume $0, TVL $0.03, 2 swaps today