Changes from ClankerHook
ClankerHookV2 is a small upgrade of ClankerHook with the following changes:- The maximum LP fee users can specify is 10% instead of 30%.
- MEV modules can set the applied LP fee for a swap, up to a maximum of 80%. If a MEV module tries to set a fee lower than the pool’s normal fee, the module’s change is ignored. Modules can still only run for up to 2 minutes.
- At token deployment, you can specify an external Pool Extension contract to be called during the hook’s
afterSwapflow. Pool extensions let developers run per-swap fee automations such as staking, buybacks of external tokens and performance-based fee unlock thresholds. Only tokens deployed via the factory can add pool extensions.
Data formats
The other major change is the format of the deployment config’sPoolConfig.poolData and the swap hookData encoding. ClankerHook didn’t expect this data in a specific shape, but ClankerHookV2 expects poolData in this format:
hookData, if present, must be encoded in this shape: