Repository navigation
Implement portfolio rebalance, milestone rewards, analytics chart, and reputation score (#1139, #1141, #1142, #1143) - #1184
Merged
Chucks1093 merged 2 commits intoOct 27, 2026
Conversation
…rorg#1142, accesslayerorg#1143 Issue accesslayerorg#1139 — Portfolio rebalance UI with target allocation configuration - Added src/services/rebalance.service.ts: getRebalancePreview POST endpoint - Added src/utils/rebalance.utils.ts: allocation validation, sum, build helpers - Added src/hooks/useRebalance.ts: useRebalancePreviewMutation and useExecuteRebalanceMutation using execute_rebalance contract call - Added src/components/common/PortfolioRebalancePanel.tsx: per-key target % inputs, running sum validator with error when not 100%, Preview Rebalance button, swap preview results, Execute Rebalance button (disabled until valid), RebalanceExecuted toast on confirmation - Wired into ProfilePage.tsx as new "Rebalance" tab Issue accesslayerorg#1141 — Holder milestone rewards tracker on portfolio page - Added src/services/milestoneRewards.service.ts: GET /wallets/:wallet/milestone-rewards - Added src/utils/milestoneRewards.utils.ts: resolveMilestoneState (claimed/claimable/locked), milestoneProgressPercent, hasAnyMilestones - Added src/hooks/useMilestoneRewards.ts: useMilestoneRewards query and useClaimMilestoneReward mutation (claim_milestone_reward contract call with optimistic cache update) - Added src/components/common/MilestoneRewardsSection.tsx: per-key milestone cards (30/90/180/365d), progress bars, claim buttons, claimed state with received amount and date, empty state - Wired into ProfilePage.tsx as new "Milestones" tab Issue accesslayerorg#1142 — Key analytics chart with daily snapshot history - Added src/services/keySnapshotHistory.service.ts: GET /keys/:key_id/snapshots?range=X - Added src/utils/keySnapshotHistory.utils.ts: buildSnapshotHistoryPoints, formatMetricValue, range/metric constants - Added src/hooks/useKeySnapshotHistory.ts: useKeySnapshotHistory query (5-min stale time) - Added src/components/common/KeyAnalyticsHistoryChart.tsx: Recharts LineChart with metric tabs (Price/Volume/Holders/Market Cap), date range picker (7d/30d/90d/All Time), tooltip with exact values, connectNulls=false for sparse data, no animation flicker on metric switch via key prop - Wired into CreatorDetailPage.tsx as "Analytics History" section Issue accesslayerorg#1143 — Key reputation score display - Added src/services/keyReputation.service.ts: GET /keys/:key_id/reputation - Added src/utils/keyReputation.utils.ts: buildReputationRadarData, clampReputationScore, reputationTier, REPUTATION_METHODOLOGY_TOOLTIP - Added src/hooks/useKeyReputation.ts: useKeyReputation query (5-min stale time) - Added src/components/common/ReputationScoreBadge.tsx: badge on discovery KeyCard showing score/1000 with tooltip explaining methodology - Added src/components/common/ReputationBreakdownPanel.tsx: Recharts RadarChart for four metrics, per-metric dl breakdown, composite score - Wired ReputationScoreBadge into DiscoveryKeyCard.tsx - Wired ReputationBreakdownPanel into CreatorDetailPage.tsx as "Reputation" section - Added queryKeys entries for snapshotHistory, reputation, milestoneRewards, rebalance
Member
|
1 similar comment
Member
|
Member
✅ PR Ready for ReviewDue to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging. This PR has passed all automated checks:
Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514 |
5 tasks
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.
Summary
This PR implements four features requested in the Stellar Wave issues.
#1139 — Portfolio rebalance UI with target allocation configuration
PortfolioRebalancePanel: per-key target % inputs with a running total validator (error when ≠ 100%), Preview Rebalance button callingget_rebalance_preview, swap preview table with estimated costs, Execute Rebalance button (disabled until allocations sum to 100%),RebalanceExecutedtoast with per-key swap summary.rebalance.service.ts,rebalance.utils.ts,useRebalance.tshook (useRebalancePreviewMutation+useExecuteRebalanceMutation).#1141 — Holder milestone rewards tracker on portfolio page
MilestoneRewardsSection: milestone cards per held key (30d/90d/180d/365d) withclaimed/claimable/lockedstates, progress bars showing days held vs next threshold, Claim buttons triggeringclaim_milestone_rewardcontract call, claimed milestones showing received amount and claim date, empty state when no milestones exist.milestoneRewards.service.ts,milestoneRewards.utils.ts,useMilestoneRewards.tshook with optimistic cache update on claim.#1142 — Key analytics chart with daily snapshot history
KeyAnalyticsHistoryChart: RechartsLineChartwith metric tab selector (Price / Volume / Holders / Market Cap), date range picker (7d / 30d / 90d / All Time), tooltip showing exact value on hover,connectNulls={false}so sparse data renders gaps instead of false lines,key={metric}on theLineChartelement eliminates animation flicker when switching metrics.keySnapshotHistory.service.ts,keySnapshotHistory.utils.ts,useKeySnapshotHistory.tshook (5-min stale time).#1143 — Key reputation score display
ReputationScoreBadge: compact badge on discovery feed KeyCards showing the score out of 1000 with a colour-coded tier and a tooltip explaining the methodology.ReputationBreakdownPanel: full breakdown on the key detail page with aRadarChartof the four component scores (trade volume, holder retention, price stability, rating) and adllisting each metric's raw value.keyReputation.service.ts,keyReputation.utils.ts,useKeyReputation.tshook.Test plan
RebalanceExecutedtoast.Closes #1139
Closes #1141
Closes #1142
Closes #1143