Agent Skill · Limit Break
lbamm-standard-hook
Configure AMM Standard Hook via Creator Hook Settings Registry
Skill body
LBAMM Standard Hook Configurator
Generate configuration scripts/contracts for the first-party AMM Standard Hook + Creator Hook Settings Registry.
Project Setup
Before generating code, check the user’s project is configured:
- Foundry:
foundry.tomlmust exist. If not:forge init - LBAMM Core:
lib/lbamm-core/must exist. If not:forge install limitbreakinc/lbamm-core - LBAMM Hooks and Handlers:
lib/lbamm-hooks-and-handlers/must exist. If not:forge install limitbreakinc/lbamm-hooks-and-handlers - Remappings:
remappings.txtneeds both@limitbreak/lbamm-core/=lib/lbamm-core/and@limitbreak/lbamm-hooks-and-handlers/=lib/lbamm-hooks-and-handlers/. Append if missing – do not overwrite existing entries. - Local testing: LBAMM is in audit and not yet on public networks. For local testing, use
lbamm-examples– seelbamm-protocol/references/local-dev.md. Generated scripts should read addresses from environment variables (vm.envAddress) so they work with the local Anvil deployment.
Instructions
-
Parse desired configuration from
$ARGUMENTS– identify what the token issuer wants to configure (trading fees, whitelists, price bounds, trading pause, pool disabling, etc.) -
Resolve ambiguities before generating – if $ARGUMENTS mentions a token without its address, references whitelists without specifying which addresses to include, or leaves fee amounts unspecified, ask in a single message. If clear, proceed.
- Map requirements to
HookTokenSettingsfields:tradingIsPaused– Pause all tradingblockDirectSwaps– Block direct (P2P) swapscheckDisabledPools– Enable pool disable/enable by token issuertokenFeeBuyBPS/tokenFeeSellBPS– Fees on token buys/sells (in token)pairedFeeBuyBPS/pairedFeeSellBPS– Fees on buys/sells (in paired token)minFeeAmount/maxFeeAmount– Fee amount boundspoolTypeWhitelistId– Restrict which pool types can be usedpairedTokenWhitelistId– Restrict which tokens can be pairedlpWhitelistId– Restrict who can provide liquidity
- Generate a Foundry script that:
- Creates whitelists via the Registry (LP, pair token, pool type) if needed
- Calls
registry.setTokenSettings()with the correctHookTokenSettings - Calls LBAMM core
setTokenSettings()with correct packed flags - Syncs hooks if needed
- Include LBAMM core
setTokenSettingscall with correct packed flags:- The AMM Standard Hook supports flags: beforeSwap (0), afterSwap (1), addLiquidity (2), poolCreation (5), flashloans (7), flashloansValidateFee (8), handlerOrderValidate (9)
- Flags removeLiquidity (3), collectFees (4), and hookManagesFees (6) are NOT supported and will cause reverts if set
- Explain each setting and distinguish:
- Pool disabling (
checkDisabledPools+setPoolDisabled) vs trading pause (tradingIsPaused) - Token fees vs paired token fees
- Whitelist IDs (0 = no restriction)
- Pool disabling (
Reference Files
references/standard-hook-api.md– Registry interface, IAMMStandardHook, who can administerreferences/standard-hook-configs.md– Common configuration examples- Protocol knowledge:
lbamm-protocol
When to Use This vs Other Hook Skills
- This skill (lbamm-standard-hook): Configure the pre-deployed first-party AMM Standard Hook via the Creator Hook Settings Registry. No custom Solidity needed – just configuration scripts. Use when built-in settings (trading fees, whitelists, pause, pool disabling) are sufficient.
- lbamm-token-hook: Generate a custom
ILimitBreakAMMTokenHookimplementation. Use when you need behavior beyond what the standard hook provides. - lbamm-pool-hook: Generate a custom
ILimitBreakAMMPoolHookimplementation. Use for per-pool behavior like dynamic fees or oracle pricing.
Skill frontmatter
user-invocable: true
disable-model-invocation: true
argument-hint: [description of desired token configuration]