Oracle hook on Base

Uniswap v4 Hook Contract 0x4cae17bff3afdd70b7db4176a92dd636593e5880 on Base · Oracle

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

What it does

A Uniswap v4 hook that records price observations for a pool and uses them to set a dynamic LP fee on swaps.

This read was written for the hook 0x0c43…5880 on Base 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

  • Initialises oracle observation storage for each pool after initialisation
  • Records observations on each swap through beforeSwap
  • Exposes observe and observationsById for reading historical price or tick data
  • Lets the stored authority address manage observation cardinality via increaseObservationCardinalityNext
  • Calls updateDynamicLPFee on the pool manager to adjust the LP fee
Swap behaviour
beforeSwap updates oracle observation state and sets a dynamic fee for the swap, while afterSwap is a view stub.
Liquidity behaviour
beforeAddLiquidity is implemented and gated by the authority or pool state; beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity are exposed as view stubs and do not appear to change state.
Fee behaviour
Uses dynamic LP fees via updateDynamicLPFee on the pool manager, with the fee likely derived from oracle observations; exact formula cannot be determined from bytecode alone.
Owner & admin controls
A single authority address (AUTHORITY() getter) appears to be set via storage slot 2; the 0x2768adc2 nonpayable function writes that slot, suggesting the authority can be changed. Its exact permissions cannot be confirmed without source.

Enabled Uniswap v4 callbacks

afterInitialize, beforeAddLiquidity, beforeSwap

afterInitialize: initialises oracle observation state for the pool. beforeAddLiquidity: gating or bookkeeping on liquidity additions. beforeSwap: updates the oracle observation and computes the dynamic fee for the swap.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: The authority address can likely change the authority via the nonpayable setter at selector 0x2768adc2, and may influence pool behaviour or fees; a compromised key could alter fee handling for pools using this hook.

Risk to user funds: The hook does not appear to hold tokens directly (no return-delta permissions are enabled), but it sets pool fees and can influence swap pricing through fees, so user funds are exposed to fee manipulation.

Security findings

  • [medium] Mutable authority address: Selector 0x2768adc2 (address argument) writes storage slot 2, which the pool logic reads, indicating a mutable privileged address.
  • [medium] Hook-controlled dynamic fee: The hook calls updateDynamicLPFee on the pool manager, so the fee is set by hook logic and could be adjusted by whoever controls its inputs.
  • [info] Unverified source: No verified source is available; function behaviour is inferred from selectors and storage access only.

Contract details

Verified source
No
Bytecode size
8,738 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Oracle hook