EchoRecycleHook on Ethereum

Uniswap v4 Hook Contract 0x585dd51eb8866d8b951b6a1349dc68fc2830bfff on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$179
Value locked (TVL)
$4.00K
All-time volume
$632.04K
Pools using this hook
1
Swaps (24h)
4 (4 traders)
Total swaps
2,787

What it does

Charges swappers a 2% project fee on the ETH side and adjusts LP fees by swap direction, while donating part of recent reversal fees back to active liquidity providers.

How it works step by step

  • Restricts the pool to one native ETH and token pair with dynamic fees and the fee recipient recorded at launch
  • Takes a 2% project fee on native ETH-side volume and mints it as redeemable ETH claims
  • Sets the LP fee from a direction streak, with 0 fee on a reversal within 32 blocks
  • On reversals, burns half of the newly earned project fee and donates it to active liquidity
  • Lets the fee recipient redeem accrued ETH claims with collectProjectFees
Swap behaviour
Each swap takes a 2% fee on the native ETH side through a before-swap return delta and mints it as an ETH claim to the hook. The LP fee depends on the direction streak: 0 on a reversal within 32 blocks, otherwise 500 to 2000 pips. Native-specified partial fills revert.
Liquidity behaviour
After-add and after-remove liquidity hooks are enabled with return deltas, but the implementation returns zero deltas and does not modify liquidity; no custom accounting is applied to LP principal.
Fee behaviour
Swaps pay a 2% project fee on the native ETH side, minted as ETH claims to the hook and redeemable by the fee recipient. The LP fee is set per swap by the direction-based echo: 500 pips for a fresh or stale direction, rising by 500 per same-direction streak step up to 2000, and 0 on a direction reversal within 32 blocks. Reversal fees are not charged to LPs but the recycle step donates half the newly earned project fee back to the pool.
Owner & admin controls
No pause or upgrade admin on the implementation. The fee recipient is the owner of the token contract, read once at initialize; that recipient can redeem accrued ETH project fee claims via collectProjectFees. Proxy upgrade authority is not visible from the input, so whoever controls the proxy can swap the implementation.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeDonate, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeInitialize and afterInitialize restrict the pool to a single native ETH/token pool and set the dynamic fee to 0 before swaps. beforeSwap computes the project fee and direction-based LP fee, and beforeSwapReturnDelta takes the project fee from the swap. afterSwap records the swap direction, mints the project fee claim, and on reversals burns and donates half of the newly earned fee to active LPs. Liquidity and donate hooks are enabled but only perform pass-through checks.

Security & trust assessment

Risk level: medium (verified source, medium confidence).

Who controls it: The fee recipient, set from the token's owner() at initialization, can withdraw all accrued ETH project fee claims. The implementation is replaceable behind the proxy, so an upgrade authority could change any fee, recycling or pool-check logic.

Risk to user funds: The hook holds ETH project fee claims inside the pool manager and takes a 2% cut of native ETH-side swap volume through return deltas. It can donate recycled claims into the pool, but principal LP funds are not moved by the hook's logic. The recipient can withdraw accrued claims. A replaced implementation could change this behaviour.

Security findings

  • [medium] Upgradeable proxy: A proxy delegates all hook callbacks, so the implementation logic can be replaced by whoever holds the proxy admin key; the code notes that this implementation is replaceable.
  • [low] Fee recipient fixed at initialization: The recipient of project fees is read from the token contract owner() at initialize; if that owner changes, the recorded recipient does not, and the owner at setup time collects all fee claims.
  • [medium] Manipulable direction signal and JIT donation capture: Tiny direction flips can alter the echo state and fee tier, and donations reward whoever holds active liquidity at the moment of reversal, enabling just-in-time liquidity capture.
  • [info] Partial native fills revert: Native-specified partial fills revert the whole swap, so unfilled volume is never charged; this is a design restriction rather than a risk.

Contract details

Verified source
Yes (EchoRecycleHook)
Compiler
solc 0.8.27+commit.40a35a09
Bytecode size
1,059 bytes
Upgradeable proxy
Yes
Detected patterns
donates, dynamic-fee, erc6909-claims, fee-sharing, moves-currency, ownable, return-delta, self-unlock, upgradeable

Pools using EchoRecycleHook