Skip to content

Add AutoCompoundFacet for keeper-driven compounding - #3

Merged
vonMangoldt merged 1 commit into
mainfrom
add-auto-compound-facet
Aug 28, 2026
Merged

Add AutoCompoundFacet for keeper-driven compounding#3
vonMangoldt merged 1 commit into
mainfrom
add-auto-compound-facet

Conversation

@vonMangoldt

Copy link
Copy Markdown
Member

Publishes the keeper-driven auto-compound facet that is deployed and source-verified on all four chains, with its selector proposals queued on all nine vaults, so the public repo matches the upcoming selector surface.

What is included

  • AutoCompoundFacet with compoundInterestOnBehalf(user): a master-allowlisted keeper bot compounds an opted-in user's settled interest into vault shares and keeps autoCompoundFeeBps (target 100 = 1%, hard cap 500) of the interest as its USD reward. The compound is the audited compoundInterest flow plus a fee split: identical modifier order, interest bucket cleared and net shares minted before the two USD transfers, and fee + net exactly offsets the cleared liability, so the accumulator identity and the sweep-buffer reservation hold. Both gates are required (master allowlists the bot, the user opts themself in), a bot compound stamps the grace lock on the minted net, and opting out is always callable, even while the vault is paused.
  • AutoCompoundDeclaration storage tail shard (slots 64-66: isAutoCompoundBot, autoCompoundAllowed, autoCompoundFeeBps), appended last in the declarations chain. This is the first shard activated onto the already-live diamonds: safe because the deployed layout ends at slot 63, so no live code path reads or writes the new slots.
  • Seven routed selectors per vault: the four functions plus the shard's three compiler-generated getters, which the frozen live dispatchers cannot serve natively.
  • The CompoundInterestOnBehalf, AutoCompoundBotSet, AutoCompoundAllowedSet and AutoCompoundFeeBpsSet events, the three errors, the autoCompoundSelectors() library entry with its getter mirror interface, the full-identity FACETS entry in check_storage_layout.sh, the regenerated layout snapshot plus the STORAGE_LAYOUT.md section, script/check_live_layout_prefix.sh (anchors the snapshot to the deployed code by compiling the verified source and byte-comparing the on-chain runtime), and the unit suite.

Live deployments (proposals queued on all nine vaults)

Chain AutoCompoundFacet
Ethereum 0xb1413B9f72e856f2aA7a91d68e6bdF00A0149b60
Base 0x80f9398b4d9F4a0Fa9A108716c902C2B56BD535A
Arbitrum 0xc40c93A30B18d5dCc0E4C59f33f7369E4472c521
Robinhood 0x0f63bDcE0f4f3531117E2ed2FE1484c5E40a75b5

All four instances are source-verified on their explorers. Selectors: 0x7d31de9c compoundInterestOnBehalf, 0x430187af setAutoCompoundAllowed, 0x42c71bd2 setAutoCompoundBot, 0x6656b5a8 setAutoCompoundFeeBps, 0x69102b0b isAutoCompoundBot, 0x5f3743df autoCompoundAllowed, 0x2ba662d6 autoCompoundFeeBps. The timelocked proposals mature on 2026-08-31; execution and fee/bot configuration follow then.

Verification on this branch

  • forge build clean
  • New suite: 26 tests, 0 failures, 100% coverage on the facet (lines, statements, branches, functions)
  • Full offline suite: 1061 tests, 0 failures
  • script/check_storage_layout.sh: diamond + 18 facets identical, 3 slim facets pinned correctly, snapshot matches (74 entries)
  • script/check_live_layout_prefix.sh: the deployed diamonds run identical bytecode on all nine vaults, their layout is an exact prefix of the committed snapshot, and slots 64-66 are untouched zeros for every live code path

@vonMangoldt
vonMangoldt merged commit 0de38b0 into main Aug 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant