Retrieve historical portfolio data for each variant over a specified time window
portfolioSize records within the time window for each variant’s modelsYYYY-MM-DDTHH:00:00.000Z)netPortfolio values within each hour bucketmodels.variant = ?aggregate array combines all variants:
history is an empty array []("createdAt", "modelId") for fast filteringPromise.all()| Window | Approx Rows | Query Time | Response Size |
|---|---|---|---|
| 24h | ~100-500 | 50-100ms | ~20KB |
| 7d | ~700-3500 | 150-300ms | ~140KB |
| 30d | ~3000-15000 | 500-1000ms | ~600KB |
30d data for longer (historical data rarely changes)staleTime for 24h window (more recent = more volatile)Portfolio Value
portfolioSize.netPortfolio from databaseCalculation:Aggregate Index
Missing Data Points