Getting Started
- Fork the repository: https://github.com/JointSave-org/Joint_Save
- Clone your fork:
git clone https://github.com/<your-username>/Joint_Save.git
cd Joint_Save
- Create a new branch:
git checkout -b feat/pool-health-score-widget
Overview
Pool members currently have no quick way to assess the health of their pools without navigating to each pool's detail page. There is no aggregated view that shows which pools need attention (approaching deadlines, missing deposits, low TVL trend) and which are healthy.
This issue adds a pool health score widget to the dashboard that computes and displays a health score for each of the user's pools, with trend indicators, actionable suggestions, and drill-down links.
Requirements
Health Score Calculation
- New utility:
frontend/lib/pool-health.ts
calculatePoolHealth(pool, members, activities) → PoolHealthScore:
score: number (0-100)
grade: 'A' | 'B' | 'C' | 'D' | 'F'
factors: depositCompliance, memberActivity, tvlTrend, deadlineProximity, disputeCount
trend: 'improving' | 'stable' | 'declining'
suggestions: string[]
- Grade mapping: A (90-100), B (70-89), C (50-69), D (30-49), F (0-29)
Dashboard Widget
Suggestion Engine Rules
depositCompliance < 80%: "X members haven't deposited for the current round"
deadlineProximity < 30%: "Deposit deadline is approaching in X days"
trend === 'declining': "TVL has decreased over the last 7 days"
memberActivity < 50%: "X members have been inactive for 30+ days"
- 0 activity in 14 days: "No activity in 2 weeks"
- Member count < 3: "Pool has very few members"
Performance
- Scores computed client-side to avoid additional API calls
- Cache computed scores for 5 minutes
- For users with >20 pools, show top 5 and a "View All" link
Acceptance Criteria
Getting Started
Overview
Pool members currently have no quick way to assess the health of their pools without navigating to each pool's detail page. There is no aggregated view that shows which pools need attention (approaching deadlines, missing deposits, low TVL trend) and which are healthy.
This issue adds a pool health score widget to the dashboard that computes and displays a health score for each of the user's pools, with trend indicators, actionable suggestions, and drill-down links.
Requirements
Health Score Calculation
frontend/lib/pool-health.tscalculatePoolHealth(pool, members, activities)→PoolHealthScore:score: number(0-100)grade: 'A' | 'B' | 'C' | 'D' | 'F'factors: depositCompliance, memberActivity, tvlTrend, deadlineProximity, disputeCounttrend: 'improving' | 'stable' | 'declining'suggestions: string[]Dashboard Widget
New component:
frontend/components/dashboard/pool-health-widget.tsxNew component:
frontend/components/dashboard/health-suggestion-list.tsxSuggestion Engine Rules
depositCompliance < 80%: "X members haven't deposited for the current round"deadlineProximity < 30%: "Deposit deadline is approaching in X days"trend === 'declining': "TVL has decreased over the last 7 days"memberActivity < 50%: "X members have been inactive for 30+ days"Performance
Acceptance Criteria