Build
Security note
Bounds
Hard limits in the hook: the cap is at most 1% and the floor at least 0.01%. Any parameter set outside them reverts.
Timelock
New parameter sets and updates wait 24 hours. Activation is permissionless after that.
What the hook holds
Only model fees waiting to be forwarded. LP positions live in the PoolManager and the hook has no liquidity callbacks. The owner can sweep the hook's balance with sweep(to, currencies); that never touches LP money.
Owner exits
- ToxicflowHook.sweep(to, currencies): every token and ETH the hook holds.
- ModelBacking.withdraw / withdrawAll: ETH, with any credit beyond the free balance shown as a shortfall.
- ModelBacking.sweepToken(token, to): tokens above what stakers are owed; stakes and pending exits stay.
Tests
Foundry tests run on a fork of the chain against the real PoolManager, the real V4Quoter and the real SPY/USDG pool: a bot pays more than a person for the same swap, the quoter sees tx.origin, closing a gap costs more than widening it, repeats pay a step, the model fee is collected and swept, and initialize only works through createPool.
