Docs · Pools
Saved hooks
A named set of Hook Blocks kept on chain: what it holds, how pools follow it, and how its versions work.
What a saved hook holds
A saved hook is a SavedHook account written by HookSave. It holds:
- a name (up to 32 bytes) and the owner's wallet;
- a full
PoolParamsrecord: the default settings for every block, checked by the same validationPoolInitruns; allowed_blocks, a bitmask of the blocks a following pool may run;- two fee ceilings:
max_lp_fee_pips, the most LP-fee room a following pool may use, andmax_take_pips, the most it may take in quote charges; - a
followingcounter.
Its address is ["hook", owner, salt, version] under the reel program. It costs the account's rent and the transaction fee; reel charges nothing to save one.
Versions
Every saved hook is immutable. To change one, the owner saves a new version under the same salt: HookSave with the previous version named writes version + 1, and only the same owner can. Version 1 has no predecessor. Older versions stay on chain, so a pool that followed version 2 can always show exactly what version 2 said.
How a pool follows one
A pool names a saved hook at PoolInit. The program then checks that the pool conforms:
- its blocks are a subset of
allowed_blocks; - its LP-fee room is at most
max_lp_fee_pips; - its quote takes are at most
max_take_pips.
A pool that doesn't conform fails with HookMismatch. A pool that does increments the hook's following count. The pool still freezes its own settings: following a hook constrains what it may run, and doesn't link it to later versions.
Saving one from the builder
Compose a board in the builder, check it, then save it as a hook from the same page. A link to the board (/builder?h=…) is not a saved hook: it lives in the URL, costs nothing and binds nobody. A saved hook is on chain, versioned, and can bound an owned root.