WethWstGbpHook on Ethereum
Uniswap v4 Hook Contract 0xe5f619ec8af334fb54ccecf6802378cd2100e0c0 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $643
- Value locked (TVL)
- $10.96K
- All-time volume
- $36.90K
- Pools using this hook
- 1
- Swaps (24h)
- 16 (9 traders)
- Total swaps
- 630
What it does
A fee-only dynamic-fee hook for a WETH/wstGBP pool that charges directional base fees and an extra surcharge on trades that push the pool price back toward a Chainlink-derived fair value, so traders pay for informed flow.
How it works step by step
- Overrides each swap's LP fee via beforeSwap using OVERRIDE_FEE_FLAG, returning zero balance delta
- Chooses a directional base fee depending on whether the swap mints wstGBP or redeems it
- Adds a toxicity surcharge only when the swap closes a deviation between pool spot price and fair value
- Computes fair value as (ETH/USD divided by GBP/USD) divided by the wstGBP NAV price using Chainlink feeds
- Falls back to a fixed fee on oracle failure, zero NAV price, or owner pause, without reverting swaps
- Emits SwapFee and OracleFallback events for off-chain monitoring
- Swap behaviour
- In beforeSwap the hook computes the deviation of pool price from the composed fair price (cached per transaction for the oracle reads, live slot0 per swap) and returns a dynamic fee; in afterSwap it emits SwapFee. No return delta is taken.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Each swap's LP fee is set by the hook via OVERRIDE_FEE_FLAG: a directional base fee depending on whether the swap is mint side (wstGBP in) or redeem side, plus a toxicity surcharge applied only when the swap closes a deviation between pool spot price and a Chainlink-composed fair price; fallbackFee is used when the oracle fails or the hook is paused. The hook takes no fee for itself and returns zero delta.
- 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 transfer is two-step; no upgradeability or other admin surface.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap
beforeInitialize validates the pool is dynamic-fee and uses the WETH/wstGBP pair; beforeSwap computes and overrides the swap fee; afterSwap emits a SwapFee event for monitoring only.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The owner can set any fee parameters within the bounds check (up to a 10% absolute fee) and can pause the oracle-based pricing, which changes the fee users pay on every swap; the owner cannot move funds, block swaps, or upgrade logic.
Risk to user funds: The hook does not hold, move or block user or pool funds; it only sets the LP fee per swap, and the fee is bounded by the owner-set parameters and a 10% ceiling.
Security findings
- [medium] Owner-adjustable swap fees: Owner can change feeParams via setFeeParams, bounded by FeeMath.checkParams with a 10% absolute fee ceiling, so swap fees can be raised substantially within that cap.
- [low] Owner pause changes pricing: setPaused forces fallbackFee for every swap in both directions without reading the oracle; swaps are not blocked but pricing is controlled by the owner.
- [info] Oracle failures do not revert swaps: Oracle failures (feed revert, stale data, zero navprice) degrade to fallbackFee instead of reverting, so the pool cannot be bricked by feed issues.
- [info] No custody of user funds: Hook is fee-only with no return-delta permissions and no custom accounting, so it cannot take or hold user tokens.
Contract details
- Verified source
- Yes (WethWstGbpHook)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 7,331 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, oracle, ownable, pausable
Pools using WethWstGbpHook
- wstGBP / WETH (Dynamic fee) — 24h volume $643, TVL $10.96K, 16 swaps today