Likely custom pricing hook on Base

Uniswap v4 Hook Contract 0x9d78f8aa8c20cfd21be3f90d3d37a7bbb5fe8088 on Base · Custom pricing

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

This hook runs custom logic on every swap, updates stored state and moves some pool currency with a return delta, so swap prices differ from the plain pool curve, but the exact trades that pay more or less cannot be confirmed from the decoded bytecode.

How it works step by step

  • Runs a custom check in beforeSwap on every swap routed through the pool
  • Reads a single storage slot (slot 0) and updates it during swaps, likely tracking state such as a counter, price snapshot or accumulated value
  • Calls the PoolManager take(currency, recipient, amount) function, so it moves pool currency out to a recipient during the swap
  • Returns a non-zero before-swap delta, so it changes the amount the swapper receives or pays, settling a custom amount outside the standard AMM curve
  • Reverts with a Panic code on arithmetic failure, indicating checked math on the computed amounts
Swap behaviour
On each swap the hook runs in beforeSwap, updates storage slot 0, takes currency from the pool via take(), and returns a before-swap delta that overrides part of the normal swap amounts. Which trade direction pays more or less cannot be determined from the decoded bytecode without the logic itself.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fee handling cannot be fully determined from decoded bytecode; the hook returns a before-swap delta and may take a custom amount from the pool, which acts as an implicit fee or rebate, but the exact rate is not visible.
Owner & admin controls
No admin controls found in the decoded selectors. No owner getter, pause function or upgrade selector was observed, but the bytecode is small and a privileged path cannot be fully ruled out.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap is used to run custom logic and move currency before the swap executes; beforeSwapReturnDelta is used to return a delta that alters the swap's input and output amounts.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: If an unseen privileged function exists, a key holder could change the delta or redirect take() recipients and so affect swap outcomes. No such function was confirmed.

Risk to user funds: The hook can take currency from the pool through take() and set the before-swap delta, so swappers and LPs may receive different amounts than the standard curve implies. It can also revert swaps through Panic-path arithmetic failures.

Security findings

  • [high] Return delta with currency movement: The hook has beforeSwapReturnDelta enabled and calls take() on the PoolManager, so it can alter swap amounts and move pool funds during a swap. The size and direction of this movement depend on logic not visible in the bytecode.
  • [medium] Unverified source: No verified source is available, so the exact conditions for taking currency and the formula for the returned delta cannot be audited.
  • [medium] Mutable storage on swap path: Storage slot 0 is both read and written inside beforeSwap, so every swap changes hook state, which can be manipulated through repeated or sandwiched swaps.
  • [info] Possible privileged path: No owner or admin selector was decoded, but the 1143-byte bytecode leaves room for a hidden privileged function that is not dispatched.

Contract details

Verified source
No
Bytecode size
1,143 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Likely custom pricing hook