RelicsV4Hook on Ethereum

Uniswap v4 Hook Contract 0xa6f73cc88723f04b85e2c2af3e35f759dc1a9440 on Ethereum · Oracle · Verified contract

Volume (24h)
$278
Value locked (TVL)
$5.31K
All-time volume
$3.28M
Pools using this hook
1
Swaps (24h)
2 (2 traders)
Total swaps
16,073

What it does

A passive observer hook for one canonical Relics pool that records swap and liquidity activity into on-chain market state used to drive relic evolution.

How it works step by step

  • Binds a single canonical Relics pool (poolId, currencies, fee, tick spacing, expected initial price) through a one-time owner call.
  • On initialization, checks the pool key and price against the bound values and seeds the market state.
  • After each swap, accumulates buy and sell volume, net Relics flow, tick-based volatility and drawdown from the all-time-high tick.
  • After each liquidity addition, accumulates liquidity magnitude and counts liquidity events.
  • Derives an epoch and stress value from swap and liquidity counts and emits state-update events for off-chain relic evolution.
Swap behaviour
afterSwap validates the pool, reads the current tick, updates buy/sell volume, net flow, volatility, drawdown and stress, advances the epoch when counts cross thresholds, and emits SwapObserved and MarketStateUpdated. It does not alter swap amounts or fees.
Liquidity behaviour
afterAddLiquidity records liquidity magnitude and tick into global market state and emits LiquidityObserved; it does not alter deltas or take tokens. Remove-liquidity callbacks are not enabled.
Fee behaviour
Does not set or take fees; uses the pool's static fee. No return deltas enabled.
Owner & admin controls
Owner (Ownable) can call bindCanonicalPool once to bind the canonical Relics pool parameters (poolId, currencies, fee, tick spacing, expected initial price and tick), can transfer or renounce ownership. No pause or upgrade mechanism found; the contract is not a proxy.

Enabled Uniswap v4 callbacks

afterInitialize, afterAddLiquidity, afterSwap

afterInitialize validates the pool key and initial price against the bound values and seeds market state; afterAddLiquidity records liquidity events for the market state; afterSwap records swap volume, net flow, tick and volatility into market state and emits SwapObserved. beforeSwap, beforeAddLiquidity, donate and return-delta permissions are disabled.

Security & trust assessment

Risk level: low (verified source, high confidence).

Who controls it: The owner can bind the canonical pool exactly once, which determines which pool the hook accepts; a malicious or mistaken binding would only make the hook reject other pools, not move funds. The owner cannot pause, change fees, or touch pool funds.

Risk to user funds: The hook does not take, hold or move tokens and returns zero deltas, so it cannot directly lose user funds. Its only effect on users is reverting operations for non-canonical pools or if the one-time binding was misconfigured.

Security findings

  • [medium] One-time owner-controlled pool binding: Owner can bind the canonical pool once, setting poolId, currencies, fee and expected initial price; after binding this cannot be changed, and an incorrect binding would block pool initialization or swaps via UnauthorizedPool.
  • [low] Manipulable entropy in state seed: Market state seed and stress values are derived from block.number and block.prevrandao, which validators can influence, so the on-chain 'market DNA' inputs are not fully unpredictable.
  • [info] No fund custody or fee taking: The hook only emits events and updates storage; it returns zero deltas and cannot hold or block user funds, so swaps and liquidity operations are not dependent on hook logic beyond pool-key validation.
  • [info] Pool gating by key match: Hook rejects any pool whose key does not match the bound pool, so swaps and liquidity adds on other pools that use this hook will revert.

Contract details

Verified source
Yes (RelicsV4Hook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
8,644 bytes
Upgradeable proxy
No
Detected patterns
oracle, ownable

Pools using RelicsV4Hook