Hookforge
CONNECT WALLET

Forge recipes

Four tested templates. Each is fixed Solidity with immutable configuration supplied through constructor arguments. Pick one and set its parameters.

Creator Fee

Collect a configurable fee after every swap and route it to a specified address. Charged on top of, and separate from, the pool LP fee.

CREATOR_FEE_V1
  1. 01AFTER SWAPTRIGGER
  2. 02CALCULATE 1.00%of the unspecified sideACTION
  3. 03SEND FEEACTION
  4. 04RECIPIENTCONNECTED WALLETOUTPUT
Callback
afterSwap
Permission
0x0044
Complexity
LOW
Config
2 parameters

Dynamic Fee

Before each swap, compare the swap size against a threshold and override the LP fee: a higher fee for large swaps, the normal fee otherwise. Requires a dynamic-fee pool.

SIZE_DYNAMIC_FEE_V1
  1. 01BEFORE SWAPTRIGGER
  2. 02SIZE > 1 (18-DEC UNITS)specified token unitsCONDITION
  3. 03SET FEE 1.00%else 0.30%ACTION
  4. 04LP FEE OVERRIDEOUTPUT
Callback
beforeSwap
Permission
0x0080
Complexity
LOW
Config
3 parameters
Pool
DYNAMIC FEE

Launch Decay

The LP fee starts high at the pool's first swap and decays linearly to the ending fee over the configured duration. The maximum fee is always the starting fee.

LAUNCH_DECAY_V1
  1. 01BEFORE SWAPTRIGGER
  2. 02TIME SINCE FIRST SWAPCONDITION
  3. 03CALCULATE RATE15.00% to 1.00% over 30 MINACTION
  4. 04LP FEE OVERRIDEOUTPUT
Callback
beforeSwap
Permission
0x0080
Complexity
MEDIUM
Config
3 parameters
Pool
DYNAMIC FEE

Max Swap

Before each swap, reject it if the specified amount exceeds the per-swap maximum. This limits swap size, not wallets: hooks see the router, not the end trader.

MAX_SWAP_V1
  1. 01BEFORE SWAPTRIGGER
  2. 02SIZE <= 5 (18-DEC UNITS)CONDITION
  3. 03ALLOW / REJECTACTION
Callback
beforeSwap
Permission
0x0080
Complexity
LOW
Config
1 parameter