Oracle hook on Soneium

Uniswap v4 Hook Contract 0x17ce2ab83f087d79901493d65a1bf71352c700cc on Soneium · Oracle

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

Charges a fixed 3% fee on buys of the fee token in matching pools, sends it to a fixed treasury, and records a price oracle history for each pool.

This read was written for the hook 0x0830…00cc on Robinhood Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Reserves 3% of exact-input buys in pools whose currency1 is the fee token, using a beforeSwap return delta.
  • Splits the reservation in afterSwap into a treasury fee (poolManager.take to treasury) and a refund to the swap sender.
  • Records a tick observation per pool on every swap in matching pools, building a tick cumulative oracle with a fixed cardinality.
  • Accrues buy credit per pool and per day based on the amount out and the pool fee, emitted as BuyCredited events.
  • Emits PriceUpdated, FeeCollected, FeeRefunded and SwapCode events for off-chain indexing.
Swap behaviour
On buys (currency1 to currency0 with feeToken as currency1, exact input), beforeSwap reserves 3% of the requested input and afterSwap takes the consumed portion as a fee to the treasury and refunds the rest. Sells and exact-output swaps skip the fee but still update the oracle and emit PriceUpdated events.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a fixed 3% (FEE_BPS = 300) on buys where currency1 is feeToken: input is reserved in beforeSwap via a return delta, then the unconsumed part is refunded and the consumed part is taken to the immutable treasury in afterSwap. Sells and exact-output edge cases are fee-free apart from the pool's own fee. Fee credit is also accrued as buyCreditAccrued per pool and per day.
Owner & admin controls
No admin controls found. Treasury and feeToken are immutable; no owner, pause or upgrade functions appear in the ABI or source.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: reserves 3% of exact-input buys and records a tick observation. afterSwap: emits price updates, splits and takes the buy fee to treasury, refunds unused reservation to the sender, and accrues buy credit. beforeSwapReturnDelta and afterSwapReturnDelta: let the hook take a share of the swap amounts as deltas, which is how the fee is collected.

Security & trust assessment

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

Who controls it: No privileged role is exposed. The treasury address is fixed at deployment, so the only party that benefits from the fee is that treasury, and it cannot be changed or paused.

Risk to user funds: The hook can take up to 3% of the input on buys of feeToken and send it to the immutable treasury; any unconsumed reservation is refunded to the swap sender. It cannot block swaps via a pause, since no pause exists.

Security findings

  • [info] Hook takes a fee via return delta: The hook takes tokens through poolManager.take and return deltas on buys of feeToken, so it can hold and redirect a portion of swap value to the treasury.
  • [info] No admin controls: Immutable treasury and feeToken; no owner, pause, or upgrade functions in the ABI, so parameters cannot be changed after deployment.
  • [low] Oracle reads may revert on young pools: observe() and observationBounds() can revert with TargetTooOld and NoObservations on pools with no or insufficient history, which only affects oracle readers.
  • [info] Fixed buy surcharge: Fee is hardcoded at 3% on buys in pools where currency1 equals feeToken; buys in such pools cost users an extra 3% relative to the pool's static fee.

Contract details

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

Pools using Oracle hook