Oracle hook on Soneium

Uniswap v4 Hook Contract 0xa6ebac50514cc260d81ba68996d4355d678d40cc on Soneium · Oracle

Volume (24h)
$0
Value locked (TVL)
$0.05
All-time volume
$0.05
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
1

What it does

Charges a fixed 3% fee on buys of the fee token and sends it to a fixed treasury, while recording a tick oracle on each fee pool.

This read was written for the hook 0x4230…40cc 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

  • Identifies fee pools by checking that currency1 equals the immutable feeToken.
  • Charges a 3% fee on buys (oneForZero) in beforeSwap for exact-in and afterSwap for exact-out.
  • Transfers collected fee-token to the immutable treasury via poolManager.take and offsets it with return deltas.
  • Records a tick observation per pool at most every 30 seconds, seeding the buffer on first swap.
  • Exposes observe, observationBounds and oracleWarm for TWAP-style tick cumulative reads.
  • Emits SwapCode and Validated events on buys for off-chain tracking.
Swap behaviour
On exact-in buys of the fee token, deducts 3% of the specified amount in beforeSwap; on exact-out buys, charges 3% of gross spend in afterSwap. Sells and non-fee pools pass through unchanged, and buys emit SwapCode when hookData is 32 bytes and Validated when amount0 is positive.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a fixed 3% (FEE_BPS = 300) on buys of the fee token: exact-in buys are charged in beforeSwap as 3% of the specified amount, exact-out buys in afterSwap as 3% of gross spend (paid + fee). The fee is taken in feeToken via poolManager.take directly to the treasury and offset through hook return deltas. Sells and pools not using feeToken as currency1 are not charged.
Owner & admin controls
No owner or pause controls found in the verified source; treasury and feeToken are immutable and set at construction. No upgrade path (non-proxy). Oracle state is written permissionlessly by swaps.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: records oracle observations on fee pools, emits SwapCode for buys with hookData, and charges exact-in buy fees. afterSwap: emits Validated for buys, charges exact-out buy fees, and skips non-fee pools. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take fees from swap deltas.

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 deployer cannot change fees or redirect funds after construction.

Risk to user funds: The hook can take fee-token from buyers on fee pools (3% of spend) and send it to the immutable treasury; it does not hold custody of pool liquidity or block swaps, as no pause or revert paths gate user trades beyond the hook's own arithmetic.

Security findings

  • [info] Buy fee taken via return deltas: The hook takes tokens via return deltas, so every buy of the fee token on a fee pool transfers 3% of spend to the treasury; this is a designed, not hidden, cost to buyers.
  • [low] Permissionless oracle writes: observe() and the oracle buffer are updated during swaps and are readable by anyone; the tick snapshot is taken before the swap in beforeSwap, which is standard but means observations depend on swap flow.
  • [info] Rounding on exact-out fee: Exact-out fee is grossed up using mulDiv on paid amount; if paid is zero the fee is zero, so the path cannot revert on dust, but rounding means fee amounts can differ slightly from the nominal 3%.

Contract details

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

Pools using Oracle hook