Context
Lenders need historical performance data to evaluate pool profitability and make investment decisions.
Current Limitation/Problem
No historical return tracking exists. Users cannot evaluate pool performance over time.
Expected Outcome
A performance tracking system that records pool APY, utilization, bad debt, and liquidity over time with configurable granularity.
Acceptance Criteria
- Capture hourly snapshots: TVL, utilization, borrow APY, supply APY, bad debt
- Aggregated metrics: 7d, 30d, 90d, 1y averages and volatility
- Performance chart: cumulative returns, APY trend, utilization heatmap
- Event tracking: liquidation events, bad debt events, parameter changes
- Performance comparison across pools with ranking
- Export performance data as CSV for external analysis
- Benchmarking against DeFi lending benchmarks (Compound, Aave rates)
Technical Scope
backend/src/services/analytics/pool-performance.ts
- Prisma:
PoolSnapshot, PoolPerformance models
- BullMQ cron for hourly snapshots
- Frontend: performance charts and comparison UI
- Edge cases: new pools with short history, data gaps from network downtime
Context
Lenders need historical performance data to evaluate pool profitability and make investment decisions.
Current Limitation/Problem
No historical return tracking exists. Users cannot evaluate pool performance over time.
Expected Outcome
A performance tracking system that records pool APY, utilization, bad debt, and liquidity over time with configurable granularity.
Acceptance Criteria
Technical Scope
backend/src/services/analytics/pool-performance.tsPoolSnapshot,PoolPerformancemodels