LiquidGuard on Ethereum
Uniswap v4 Hook Contract 0x8ff5660951c974f4806f0bef9a32bcf35d3ae0cc on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $10.78K
- All-time volume
- $0
- Pools using this hook
- 24
- Swaps (24h)
- 2 (1 traders)
- Total swaps
- 2,290
What it does
LiquidGuard skims a configurable RARE-denominated fee from swaps in pools that pair RARE with a Liquid token and forwards it to a fee distributor.
How it works step by step
- Charges totalFeeBPS on RARE amounts in swaps across RARE/Liquid pools
- Takes the fee from PoolManager and transfers it to feeDistributor
- Notifies the distributor of each fee and continues if the notification fails
- Returns the fee as a hook delta in beforeSwap or afterSwap so PoolManager accounting nets to zero
- Restricts pool initialization to allowlisted initializer addresses
- Swap behaviour
- On swaps where RARE is the specified currency, beforeSwap takes the fee via PoolManager and returns it as a specified delta; on swaps where RARE is the unspecified currency, afterSwap takes the fee and returns it as an unspecified delta. Non-RARE pools and zero-amount or zero-fee swaps pass through unchanged.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- A RARE-side fee of totalFeeBPS (set from the feeDistributor) is taken on swaps where RARE is the specified currency in beforeSwap or the unspecified currency in afterSwap, computed on the absolute swap amount and clamped below the swap amount. The fee is sent to feeDistributor via PoolManager.take and the distributor is notified; if no distributor is set, no fee is charged.
- Owner & admin controls
- Owner (Ownable) can set feeDistributor via setFeeDistributor, which also sets totalFeeBPS from the distributor's value (must be at most 10000); owner or factory can add initializers to the beforeInitialize allowlist; only owner can set factory, remove initializers and transfer or renounce ownership. No pause or upgrade mechanism is present; the contract is not a proxy.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize restricts pool initialization to allowlisted sender addresses. beforeSwap takes the RARE fee when RARE is the specified currency and returns it as a specified-side delta. afterSwap takes the fee when RARE is the unspecified currency and returns it as an unspecified delta. beforeSwapReturnDelta and afterSwapReturnDelta enable those returned deltas.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can set the feeDistributor and totalFeeBPS (up to 100% of RARE swap amounts, since the clamp keeps fee below the swap amount), redirect fee recipients, and grant or revoke pool-initialization rights. Factory can also add initializers.
Risk to user funds: The hook takes RARE from PoolManager on each eligible swap and sends it to feeDistributor, so it moves trader and pool value. It does not custody funds itself, and the owner can change where fees go and how large they are, but it cannot block swaps except via the distributor's totalFeeBPS being invalid during configuration.
Security findings
- [medium] Owner can set fee up to 100%: setFeeDistributor lets the owner set totalFeeBPS to any value up to 10000 (100%) by pointing to a distributor that reports it, taking nearly all RARE swap value from traders.
- [low] No timelock on fee and distributor changes: The hook is deployed with a mined address and the fee and distributor can be swapped at any time by the owner, with no timelock or cap below 100%.
- [info] Distributor failure does not revert swaps: Fee notification is wrapped in try/catch and emits FeeNotifyFailed, so distributor failures do not block swaps, but the take still sends RARE to the distributor address.
- [info] Initialization allowlist: Pool initialization is restricted to allowlisted senders, so only whitelisted Liquid token contracts can create pools with this hook.
Contract details
- Verified source
- Yes (LiquidGuard)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 4,286 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using LiquidGuard
- 3030 / RARE (0.00% fee) — 24h volume $0, TVL $2.34K, 2 swaps today
- CORPUS / RARE (0.00% fee) — 24h volume $0, TVL $6.37K, 0 swaps today
- NORML / RARE (0.00% fee) — 24h volume $0, TVL $410, 0 swaps today
- MAGIC / RARE (0.00% fee) — 24h volume $0, TVL $2.29, 0 swaps today
- PHET / RARE (0.00% fee) — 24h volume $0, TVL $130, 0 swaps today
- ANGEL / RARE (0.00% fee) — 24h volume $0, TVL $1.01K, 0 swaps today
- SWTH / RARE (0.00% fee) — 24h volume $0, TVL $19, 0 swaps today
- RARE / MOTOR (0.00% fee) — 24h volume $0, TVL $304, 0 swaps today
- PIGEON / RARE (0.00% fee) — 24h volume $0, TVL $29, 0 swaps today
- HAND / RARE (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- SMOKE / RARE (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- RARE / KETTLEOR (0.00% fee) — 24h volume $0, TVL $149, 0 swaps today
- POPPEPE / RARE (0.00% fee) — 24h volume $0, TVL $15, 0 swaps today
- RARE / PEPO (0.00% fee) — 24h volume $0, TVL $13, 0 swaps today
- DRIFT / RARE (0.00% fee) — 24h volume $0, TVL $1.09, 0 swaps today
- MOON / RARE (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- BITCOIN / RARE (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- CORPUS / RARE (0.00% fee) — 24h volume $0, TVL $0.25, 0 swaps today
- RARE / HANDMAN (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- RARE / MMY (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today