DualPoolHook on Ethereum

Uniswap v4 Hook Contract 0x00000078bd49d5279a99b5f4011a5c61ee8caac0 on Ethereum · Liquidity management · Verified contract

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

What it does

A Uniswap v4 hook that pools liquidity from LPs and deploys it as concentrated multi-range positions just before each swap, then returns idle capital to optional ERC-4626 vaults, giving LPs proportional shares of the managed pool.

How it works step by step

  • Pools LP deposits and mints proportional shares, seeded by an owner bootstrap that sets the initial price ratio.
  • Before each swap, deploys liquidity across owner-configured tick-range buckets weighted by allocation.
  • After each swap, removes the JIT positions and settles the hook's net deltas with the PoolManager.
  • Rehypothecates idle balances into owner-configured ERC-4626 vaults and withdraws them as needed.
  • Blocks external LP add/remove on the v4 pool so only hook-managed liquidity is present.
  • Supports owner pause, external-deposit toggling, and emergency vault revocation.
Swap behaviour
beforeSwap reverts if the pool is paused, sets the JIT lock, withdraws the needed assets from claims and vaults, and deploys bucketed liquidity. afterSwap removes those positions, settles net deltas with the PoolManager, redeposits idle balances to vaults and clears the lock. The swap uses the pool's static fee.
Liquidity behaviour
Adding liquidity mints shares for proportional deposits (addLiquidity, plus owner-only bootstrap); removing burns shares and returns proportional tokens, redeeming ERC-6909 claims and withdrawing from ERC-4626 vaults as needed. External v4 modifyLiquidity calls are rejected; only the hook itself deploys positions, and only during a swap's JIT cycle. Deposits are blocked within a configurable minDepositBlocks window to deter same-block sniping.
Fee behaviour
Pool fee is the static PoolKey.fee set at creation; dynamic-fee pools are rejected at initialization. The hook does not change fees and returns no fee override. Fees accrue to the pool's LP positions while JIT liquidity is deployed during each swap.
Owner & admin controls
Owner (Ownable2Step, renounce disabled) can bootstrap pools, set distribution buckets and weights, toggle per-pool liveness (pause/resume swaps), toggle external deposits, refresh vault approvals, and run emergencyRevokeVault which pauses the pool, disables external deposits, zeroes both vault allowances and best-effort drains vault holdings. Pool LP fee is fixed at creation and cannot be changed; owner cannot alter swap fees.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap

beforeInitialize: blocks direct poolManager.initialize so pools must go through the guarded initializePool. beforeAddLiquidity and beforeRemoveLiquidity: revert external LP changes so only hook-managed JIT liquidity exists. beforeSwap: checks liveness, sets the JIT lock, withdraws from vaults and deploys concentrated multi-range liquidity for the swap. afterSwap: removes JIT positions, settles net deltas with the PoolManager, redeposits idle balances to vaults and clears the lock.

Security & trust assessment

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

Who controls it: The owner can pause any pool, reconfigure the liquidity distribution, enable or disable deposits and emergency-revoke vault exposure. The owner can also bootstrap pools and mint the initial shares to itself. The owner cannot change swap fees or withdraw depositor shares directly, but a malicious or compromised owner could reshape distribution or pause to trap LP exits in ways that disadvantage LPs.

Risk to user funds: The hook holds LP deposits as raw ERC-20, ERC-6909 claims and ERC-4626 vault shares, and it settles swap deltas with the PoolManager. Depositor funds could be affected by vault failure or a compromised vault allowance, and by owner actions that pause or reconfigure pools. Traders' swaps route through hook-held JIT liquidity, so pool solvency depends on the vault and owner.

Security findings

  • [medium] Owner can pause swaps per pool: The owner can call setPoolLive(false) to make all swaps revert with PoolNotLive; removeLiquidity remains available so LPs can still exit, but trading and fee accrual stop.
  • [medium] Owner can reconfigure liquidity distribution: setDistribution can reshape bucket ticks and weights between cycles, changing where the hook concentrates capital and therefore the execution and fee profile for traders, though not while a JIT cycle is in flight.
  • [medium] Unlimited allowance to external ERC-4626 vaults: Vault integrations are trusted: the hook grants unlimited ERC-20 allowances to configured ERC-4626 vaults and sends idle assets there. A compromised or malicious vault could take approved funds, and the owner's emergencyRevokeVault is the only mitigation.
  • [low] Single owner governs all pools: Pool initialization, deposit gating, distribution and vault binding are owner-controlled, and renounceOwnership is disabled, so the owner is a single trust point. Ownership can be rotated via two-step transfer.
  • [info] No protocol fee skimming observed: Deposited liquidity is held by the hook and reflected in shares; the hook does not take fees from users and does not use return deltas, so funds are not directly taken beyond normal swap settlement.

Contract details

Verified source
Yes (DualPoolHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
23,999 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, liquidity-management, moves-currency, ownable, self-unlock

Pools using DualPoolHook