feat: rebalance exposure caps, cost-aware rebalancing, correlation, yield composition (#346 #347 #348 #349) - #388
Merged
Abidoyesimze merged 1 commit intoAug 29, 2026
Conversation
…ield composition - Neurowealth#346: per-protocol exposure caps with risk-tolerance defaults, residual routing and tighten-only merge; wired into the agent rebalance loop. - Neurowealth#347: grounded rebalance cost model (network fee, price impact, entry/exit) with a conservative payback gate, replacing the flat /1e18 heuristic. - Neurowealth#348: portfolio APY correlation matrix + weighted diversification score endpoint (null-on-degenerate, mandatory caveat). - Neurowealth#349: yield base/incentive decomposition with haircuted effective APY, schema + migration, flag-gated optimizer/agent consumption, emissions risk modifier, and a yield-breakdown endpoint. Adds unit + integration tests, OpenAPI/docs updates. Closes Neurowealth#346 Closes Neurowealth#347 Closes Neurowealth#348 Closes Neurowealth#349
|
@devsimze 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! 🚀 |
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.
What this does
Four related risk/analytics capabilities for the agent and portfolio analytics:
$0.50//1e18heuristic with a grounded network-fee/slippage/entry-exit model and a conservative payback gate; fallback decisions are held to a higher bar, never lower.GET /api/v1/analytics/correlationwith an APY-correlation matrix and a 0–100 weighted diversification score; null-on-degenerate, mandatory caveat.ProtocolRategainsbaseApy/incentiveApy/rewardTokens(with migration), a haircutedeffectiveApy,GET /api/v1/analytics/yield-breakdown, an emissions-dependency risk modifier, and flag-gated (USE_EFFECTIVE_APY) optimizer/agent consumption.Pure-core / DB-glue split is maintained throughout so the statistics are unit-testable.
Verification
tsc --noEmitcleaneslint src testscleanprettier --checkcleanredocly lint docs/openapi.yaml— API description valid/correlation,/yield-breakdown.Documentation
REBALANCE_EXPOSURE_COST.md(Per-Protocol Exposure Caps Enforced in the Agent Loop #346/Fee- & Slippage-Aware Rebalancing with a Payback-Period Gate #347),CORRELATION_DIVERSIFICATION.md(Portfolio Correlation Matrix & Diversification Score #348),YIELD_COMPOSITION.md(Yield-Source Decomposition (Base vs. Incentive-Token Yield) #349) +DOCUMENTATION_INDEX.mdentries and cross-references inSTRATEGY_MARKETPLACE.md/PROTOCOL_RISK_SCORING.md.openapi.yamldocuments both new endpoints.Closes #346
Closes #347
Closes #348
Closes #349