feat: add auto-compound yield reinvestment - #686
Open
WALEY-OPS wants to merge 6 commits into
Open
Conversation
|
@WALEY-OPS Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
orebams
pushed a commit
to orebams/NeuroWealth-Smartcontract
that referenced
this pull request
Aug 29, 2026
…owealth#686, Neurowealth#687) - AuditTrail: hoist useMemo above the loading-gated early return so hook order stays stable across the loading -> loaded transition - global-error.tsx: catch render-time throws above RootLayout (e.g. in ClientProviders) with the app's branded ErrorPage instead of Next's default unbranded error page - useNotificationPreferences: guard the localStorage JSON.parse with a try/catch that falls back to DEFAULT_PREFERENCES and repairs corrupted storage, matching useNotifications - StrategySelector: add an AbortController to the fetch-on-mount effect, surface failures via an error banner with retry instead of silently treating them as "no strategy saved", and log via lib/logger Closes Neurowealth#684 Closes Neurowealth#685 Closes Neurowealth#686 Closes Neurowealth#687
orebams
pushed a commit
to orebams/NeuroWealth-Smartcontract
that referenced
this pull request
Aug 29, 2026
…ixes fix: round-3 audit follow-ups (Neurowealth#684, Neurowealth#685, Neurowealth#686, Neurowealth#687)
Contributor
|
Pls fix conflicts |
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.
Overview
This PR adds an Auto-Compound Yield Reinvestment engine that harvests accrued yield from the current protocol and immediately re-deposits it into the same protocol, maximizing compound growth without user intervention — with gas-efficient single-transaction compounding and configurable compound frequency.
Related Issue
Closes #
Changes
🔁 Auto-Compound Reinvestment Engine
[ADD]
neurowealth-vault/contracts/vault/src/topics.rsauto_compound(min_out)agent-only topic handler for harvesting and reinvesting accrued yield.CompoundEventwith the compounded amount after successful reinvestment.[MODIFY]
contract-spec.jsonauto_compound(min_out)in the agent-callable ABI with agent-only access control andCompoundEventschema.[MODIFY]
agent/src/index.tsauto_compound(min_out).min_outslippage protection.[MODIFY]
neurowealth-vault/contracts/vault/src/tests/test_yield.rsmin_outslippage reverts, agent-only guard, cooldown enforcement, andTotalAssetsrecalculation.[MODIFY]
docs/state-machine.mdauto_compoundstate transition, cooldown semantics, andCompoundEvent.[MODIFY]
ARCHITECTURE.mdharvest()flow.Verification Results
auto_compound(min_out)agent-only functionTotalAssetsto reflect compounded amountTotalAssetsrecalculated after compoundCompoundEventwith amount compoundedtopics.rsARCHITECTURE.mdandstate-machine.mdCloses #644