QHooks Lab / Volatility Fee

A fee that rises when the price runs.

Give one pool an LP fee that follows the market. Every swap adds the distance it moved the price to a movement score that fades with time; the next swap pays the base fee plus a charge for that movement, up to a cap. The trade that chases a jump, or closes a sandwich, pays more, and LPs earn most when they are most exposed.

Integration notes

local builds · not independently audited.

Configuration

The pool’s two tokens, lower address first. The hook accepts exactly one pool: these tokens, this tick spacing and the dynamic-fee flag.

Build & exports

Downloads

What your build includes

Your configured hook and the complete 48-file Solidity source project (the hook, Uniswap v4-core as pinned) with its compiler input and third-party notices.

This builder targets local chain 31337. Building here is free and does not connect a wallet, deploy contracts or move funds. To put the hook on Base, Robinhood Chain, Ethereum, Arbitrum One or BNB Chain, use the deploy panel below.

How it works

After each swap the hook adds the ticks that swap moved the price (1 tick ≈ 0.01%) to its movement score; the score halves every half-life with no trading. Before each swap it sets that swap’s LP fee to base fee + score × charge, capped. currentFee() reads the fee the next swap pays; score() reads the movement.

Anyone can raise the fee by moving the price, and pays for it; nobody can lower it. No owner and no keys: nothing can be changed after deployment. The pool must be created with the dynamic-fee flag.

Other Lab templates

All QHooks tools

Your wallet

No wallet extension needed. Your QWallet quantum key stays separate.

Connect your phone with a QR code.

Uses MetaMask Connect, copyright ConsenSys. License

Choose an EVM wallet.

No wallet detected in this browser.

Open qhooks.com in Chrome with your wallet extension enabled, or in your wallet app’s built-in browser.

The in-app preview cannot access Chrome’s wallet extensions. Use MetaMask Mobile above to pair your phone.

Connecting does not authorize spending. Every signature and transaction needs your approval. Never enter your recovery phrase here.