Friar on Robinhood Chain

Uniswap v4 Hook Contract 0xfeda24f0d3805170e7566ce617cfba01ce05d080 on Robinhood Chain · Dynamic fee · Verified contract

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$57.72K
Pools using this hook
34
Swaps (24h)
0 (0 traders)
Total swaps
8,290

What it does

Friar charges traders a fee that starts low in calm markets and rises with recent price movement up to a 10% cap, with the whole fee going to liquidity providers, so swaps made during volatile periods pay more and swaps in calm periods pay less.

How it works step by step

  • Sets the LP fee of a v4 dynamic-fee pool on every swap using a Liquidity Book style volatility accumulator
  • Tracks the tick bucket (tick divided by tickSpacing) of each pool and raises the accumulator when price has moved between buckets
  • Keeps a volatility reference that is refreshed after a filter period and decays by reductionFactor within the decay period, or resets to zero after it
  • Computes total fee as base fee (baseFactor times tickSpacing) plus a variable fee that grows with the square of the accumulator, capped at 10%
  • Returns the fee with the override flag from beforeSwap so the pool uses it for that swap
  • Exposes previewFee and volatilityState views for off-chain quoting
Swap behaviour
Before each swap the hook reads the current tick, updates the pool's volatility state and returns a fee override. Calm markets with little recent tick movement pay the low base fee; swaps arriving after large recent price movement pay a higher fee, up to a 10% cap. Fees rise for swaps during volatile periods and fall back toward the base fee as the volatility reference decays. The hook takes no swap deltas.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The LP fee is set dynamically per swap as base plus variable fee, hard-capped at 10%. The entire fee goes to liquidity providers; the hook takes no protocol fee.
Owner & admin controls
No owner, admin functions or upgradeability found. All parameters are immutable constructor values; changing them requires deploying a new hook.

Enabled Uniswap v4 callbacks

afterInitialize, beforeSwap

afterInitialize validates that the pool uses a dynamic fee, checks the base fee is within the cap and initializes the pool's volatility state. beforeSwap updates the volatility state and returns the per-swap LP fee with the override flag.

Security & trust assessment

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

Who controls it: No privileged key is present. Parameters cannot be changed after deployment, so no operator can alter fees on existing pools.

Risk to user funds: The hook cannot hold, move or block user or pool funds. Its only effect is the LP fee returned during beforeSwap, which is paid to liquidity providers.

Security findings

  • [info] Fee cap enforced: totalFeePips caps the fee at 10% (MAX_FEE_1E18), and afterInitialize rejects pools whose base fee exceeds the cap.
  • [info] No fund-moving capability: Only afterInitialize and beforeSwap are enabled and beforeSwapReturnDelta is false, so the hook cannot take swap deltas or hold liquidity.
  • [low] One-swap lag in fee response: Price movement caused by a swap only raises the fee for later swaps, so the fee does not react within the same swap as Liquidity Book does per bin.

Contract details

Verified source
Yes (Friar)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
5,828 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Friar