Time-Series Analysis
Use pre-computed time-series tables for efficient analytics.
Query Structureβ
query GetDailyPriceStats($termId: String!, $curveId: numeric!, $limit: Int!) {
share_price_change_stats_daily(
where: {
term_id: { _eq: $termId }
curve_id: { _eq: $curveId }
}
order_by: { bucket: desc }
limit: $limit
) {
bucket
first_share_price
last_share_price
difference
change_count
}
}
Available Tablesβ
- share_price_change_stats_hourly: Hourly price aggregations
- share_price_change_stats_daily: Daily price aggregations
- share_price_change_stats_weekly: Weekly price aggregations
- share_price_change_stats_monthly: Monthly price aggregations
- signal_stats_daily: Daily signal aggregations
- signal_stats_hourly: Hourly signal aggregations
- signal_stats_monthly: Monthly signal aggregations
Best Practicesβ
- Use pre-computed tables for charts and analytics
- Choose appropriate granularity (hourly/daily/weekly/monthly)
- Order by bucket for time-based queries
- Limit results to relevant time period