ReverseV4Hook on Base
Uniswap v4 Hook Contract 0xcfb58e7bded50f2c00cc84863269e0cfef9f75cd on Base · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A dynamic-fee hook that charges swaps moving the price away from an external reference a higher fee (capped at 10%) plus up to a 10% tax, while swaps that move the price back pay less and may get a rebate from that tax, with LPs free to withdraw anytime.
How it works step by step
- Sets a dynamic LP fee per swap, capped at 10%, built from a base fee plus components for deviation from an external reference price, recent price volatility, network base-fee drift and optional extras (zones, price impact, anti-sandwich).
- Swaps that push the pool price further from the reference price are 'toxic': they pay a higher fee plus a fixed tax of up to 10% of their input, held by the hook as claims in the PoolManager.
- Swaps that pull the price back toward the reference are 'corrective': exact-input ones can receive a rebate paid only from tax collected from toxic swaps, and repeat correctors earn a loyalty fee discount.
- Credential holders pay a lower member fee, and swaps that include an address in hookData earn ERC-1155 points on their input at admin-set rates.
- Liquidity callbacks do nothing and never block or charge LPs.
- Swap behaviour
- Each swap pays a dynamic LP fee between the pool's configured minimum and maximum (never above 10%); toxic swaps also pay a tax of up to 10% of their input, and corrective exact-input swaps may receive a rebate from accumulated tax. A swapper can set a fee cap in hookData, and in the default mode the swap reverts if the fee would exceed it.
- Liquidity behaviour
- The add and remove liquidity callbacks return zero delta and do nothing, so LPs can add and withdraw freely with no fee or block.
- Fee behaviour
- The LP fee is computed per swap and clamped to the pool's min/max, with a hard ceiling of 10%; it rises with deviation from the reference, volatility and other components and goes to LPs. Toxic swaps additionally pay an immutable tax (at most 10%) kept by the hook, and rebates to correctors (never above the tax rate) are paid only out of that tax.
- Owner & admin controls
- The admin can change the reference price oracle, set points rates (up to 100% points, no funds involved), and set a pool's fee config and components only before that pool is initialized, within the 10% cap. It cannot change tax or rebate rates, live pool fees, move funds, or pause swaps.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta, afterRemoveLiquidityReturnDelta
beforeInitialize: only the fixed initializer can open pools and they must be dynamic-fee; afterInitialize: sets the starting fee; afterAddLiquidity/afterRemoveLiquidity (with return delta): no-ops returning zero; beforeSwap (with return delta): computes the fee and takes exact-input tax; afterSwap (with return delta): updates volatility/gas state, takes exact-output tax or pays rebates, credits points.
Security & trust assessment
Risk level: low (verified source, medium confidence).
Who controls it: An admin (intended multisig) controls the oracle, points rules and pre-launch fee configs; a fixed initializer alone can open pools. Neither can move funds, pause swaps or exceed the 10% fee and tax caps.
Risk to user funds: The hook can take up to 10% of a toxic swap's input as tax on top of an LP fee of up to 10%; collected tax stays as claims that only fund rebates. LP principal cannot be locked or drained.
Security findings
- [low] Swap tax up to 10%: Toxic swaps pay an immutable tax of at most 10% of input, kept as hook claims and used only to fund corrective rebates; there is no withdrawal function for the admin in the visible source.
- [low] Admin can swap the reference oracle: Changing the oracle changes which swaps are classed toxic or corrective, but fee stays capped at 10% and tax at its fixed rate; a broken oracle just falls back to the base fee.
- [info] LP withdrawals unrestricted: Remove-liquidity callbacks return zero delta and never revert, so LP principal cannot be locked or charged.
Contract details
- Verified source
- Yes (ReverseV4Hook)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 24,527 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc6909-claims, mev-protection, oracle, return-delta, rewards, tax
Pools using ReverseV4Hook
- ETH / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today