Skip to content

feat(analytics): add portfolio rebalancing suggestions and health sco…#546

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
shakourllahfashola-dev:Add_portfolio_rebalancing_suggestions
Jun 24, 2026
Merged

feat(analytics): add portfolio rebalancing suggestions and health sco…#546
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
shakourllahfashola-dev:Add_portfolio_rebalancing_suggestions

Conversation

@shakourllahfashola-dev

Copy link
Copy Markdown
Contributor

Closes #509

PR Description
Summary

This PR adds portfolio analytics capabilities to the propchain-analytics contract:

[get_rebalancing_suggestions(owner)](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
[get_portfolio_health_score(owner)](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)

It enables owners to receive recommendation output and a 0-100 health score based on:

current allocation by property type
market trend signals per property type
diversification and concentration risk

What changed

Added new data types:
    [PortfolioPosition](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    RebalancingSuggestion
Added storage fields:
    portfolio_positions
    property_type_trends
Added contract methods:
    [set_portfolio_positions](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    [get_portfolio_positions](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    [update_property_type_trend](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    [get_property_type_trend](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    [get_rebalancing_suggestions](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
    [get_portfolio_health_score](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)
Added tests validating:
    low health score for a concentrated portfolio
    high(er) health score for a diversified portfolio
    rebalancing suggestions updating when market trends shift

Files changed

[lib.rs](https://turbo-acorn-6976rp7vx6p9cxxxv.github.dev/)

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@shakourllahfashola-dev 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! 🚀

Learn more about application limits

@nanaf6203-bit nanaf6203-bit merged commit cb900bb into MettaChain:main Jun 24, 2026
1 of 14 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.

feat: Add portfolio rebalancing suggestions based on market trends

2 participants