Add AutoCompoundFacet for keeper-driven compounding - #3
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
compoundInterestOnBehalf(user): a master-allowlisted keeper bot compounds an opted-in user's settled interest into vault shares and keepsautoCompoundFeeBps(target 100 = 1%, hard cap 500) of the interest as its USD reward. The compound is the auditedcompoundInterestflow plus a fee split: identical modifier order, interest bucket cleared and net shares minted before the two USD transfers, andfee + netexactly 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.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.CompoundInterestOnBehalf,AutoCompoundBotSet,AutoCompoundAllowedSetandAutoCompoundFeeBpsSetevents, the three errors, theautoCompoundSelectors()library entry with its getter mirror interface, the full-identityFACETSentry incheck_storage_layout.sh, the regenerated layout snapshot plus theSTORAGE_LAYOUT.mdsection,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)
0xb1413B9f72e856f2aA7a91d68e6bdF00A0149b600x80f9398b4d9F4a0Fa9A108716c902C2B56BD535A0xc40c93A30B18d5dCc0E4C59f33f7369E4472c5210x0f63bDcE0f4f3531117E2ed2FE1484c5E40a75b5All four instances are source-verified on their explorers. Selectors:
0x7d31de9ccompoundInterestOnBehalf,0x430187afsetAutoCompoundAllowed,0x42c71bd2setAutoCompoundBot,0x6656b5a8setAutoCompoundFeeBps,0x69102b0bisAutoCompoundBot,0x5f3743dfautoCompoundAllowed,0x2ba662d6autoCompoundFeeBps. The timelocked proposals mature on 2026-08-31; execution and fee/bot configuration follow then.Verification on this branch
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