Build a Hook Block
Build a new Hook Block as an advisory: the interface, the template, the conformance tests, the submission and what you earn.
A new Hook Block is an advisory: a contract HookrRoot asks for bounded advice on each swap and each liquidity add. The files and templates are in hookr-contracts.
- Implement
IHookrAdvisory.bindfreezes a pool's settings at launch.beforeSwapandafterSwapreturn a fee surcharge, a take with its recipient, or a refusal, within the pool's caps.beforeAddLiquidityallows or refuses an add. - Start from
TemplateAdvisory.sol, the smallest advisory that passes the conformance suite. - Test it. Inherit
AdvisoryConformance.solin your test and build with solc 0.8.37. - Submit it. Open an advisory submission with a public repository at a pinned commit, what
bindtakes, the most it will ever ask for (maxLpFeePips,maxQuoteTakePips,maxSubjectTakeBps,gasLimit) and the test command with its result. - Review. Hookr checks it against
IHookrAdvisoryand the conformance suite. Once accepted, the registry admits it at its exact code hash behind a timelock, and launches can pick it. - What you earn. Your advice names the recipient of its take, on every pool that picks your block, within the caps it was admitted with.
A fail-open advisory may not refuse or take from a swap. A pool binds one advisory.