UsdcWstGbpHook on Ethereum
Uniswap v4 Hook Contract 0x09ff2eb94d873c6b4befde087362044a2b02e0c0 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $834
- Value locked (TVL)
- $4.17K
- All-time volume
- $15.13K
- Pools using this hook
- 1
- Swaps (24h)
- 9 (6 traders)
- Total swaps
- 280
What it does
A fee-only dynamic-fee hook for a wstGBP/USDC Uniswap v4 pool that charges swappers a directional fee, adding a surcharge to flow that pushes the pool price back toward a Chainlink-based fair value.
How it works step by step
- Computes a fair wstGBP-per-USDC price from a Chainlink GBP/USD feed and the wstGBP navprice
- Reads live pool slot0 on every swap and measures its deviation from fair
- Charges a base fee plus a toxicity surcharge only to flow that closes the deviation
- Falls back to a flat fallbackFee if the oracle is stale, invalid, or navprice is zero
- Allows the owner to pause and force fallback pricing in both directions without blocking swaps
- Emits SwapFee and OracleFallback events for off-chain monitoring
- Swap behaviour
- On every swap beforeSwap reads the paused flag and, if not paused, a cached or freshly computed fair price, then compares live pool price with fair to derive the deviation and a directional fee; on oracle failure or pause it uses fallbackFee. afterSwap emits a SwapFee event. No swap is blocked and no token deltas are taken.
- Liquidity behaviour
- No liquidity callbacks. LPs add and remove liquidity directly through the PoolManager as in a normal AMM pool.
- Fee behaviour
- Each swap is charged a directional LP fee chosen by the hook: a base fee plus a toxicity surcharge applied only to flow that closes the deviation between pool price and a Chainlink-derived fair price (1 / (GBP/USD x wstGBP navprice)). Flow that moves the pool further from fair pays the base; flow that closes the deviation pays base plus surcharge. Fallback fee is used when the oracle fails, navprice is zero, or the owner has paused the hook. Fee is returned with the OVERRIDE_FEE_FLAG; no return-delta or custom accounting.
- Owner & admin controls
- Owner (Ownable2Step, multisig) can call setFeeParams to retune the fee parameters (bounds-checked, absolute fee ceiling 10%) and setPaused to force fallbackFee pricing on every swap. Ownership can be transferred via transferOwnership/acceptOwnership or renounced. No upgradeability and no other admin surface.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap
beforeInitialize: rejects non-dynamic-fee pools and pools whose currencies differ from the configured wstGBP/USDC pair. beforeSwap: computes and overrides the per-swap LP fee from the oracle deviation (or fallback/paused fee) and returns zero delta. afterSwap: emits the SwapFee event for off-chain monitoring; no state changes or deltas.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: A single owner key controls fee parameters within the bounded ranges and can pause the hook, forcing a flat fallback fee on all swaps. The owner cannot block swaps, move funds, or upgrade the logic.
Risk to user funds: The hook holds no funds and returns zero delta, so it cannot take, move or lock pool or user tokens. Its only effect on funds is the per-swap LP fee it sets, which can be shifted within bounds by the owner.
Security findings
- [info] Swaps never revert on oracle failure: Oracle reads are isolated: any feed failure, stale value, or zero navprice degrades to fallbackFee rather than reverting, so swaps are not blocked by oracle state.
- [medium] USDC depeg is not detected on-chain: The composed fair price uses only a GBP/USD feed and wstGBP navprice; USDC is assumed to be $1.00. A USDC depeg is not observable on-chain and would misclassify flow direction for the surcharge until the owner pauses the hook.
- [medium] Owner can change fee parameters and pause pricing: Owner can set fee parameters within bounds (absolute fee ceiling 10%) and can pause, changing the fee paid by all swappers and LPs' fee income without any timelock described in the code.
- [low] Manipulation resistance relies on pairing oracle with pool spot: Fair-price cache is transient per transaction and the deviation is recomputed from live slot0 each swap, limiting intra-transaction oracle manipulation; pool price manipulation is self-defeating because it pays the base fee.
Contract details
- Verified source
- Yes (UsdcWstGbpHook)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 6,791 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, oracle, ownable, pausable
Pools using UsdcWstGbpHook
- wstGBP / USDC (Dynamic fee) — 24h volume $834, TVL $4.17K, 9 swaps today