Analytics & Dashboards
Turn indexed Solana data into product and business insights with materialized views, metrics layers, and dashboard tools.
Search across all documentation pages
Turn indexed Solana data into product and business insights with materialized views, metrics layers, and dashboard tools.
Quick-reference recipe card - copy-paste ready.
CREATE MATERIALIZED VIEW daily_volume AS
SELECT date_trunc('day', ts) AS day, SUM(amount_usd) AS volume
FROM swaps
GROUP BY 1;
REFRESH MATERIALIZED VIEW CONCURRENTLY daily_volume;When to reach for this:
-- Core metrics tables populated by indexer
SELECT
program_id,
COUNT(DISTINCT user_wallet) AS dau,
SUM(fee_lamports) / 1e9 AS fees_sol
FROM events
WHERE slot >= (SELECT max(slot) - 216000 FROM events) -- ~24h rough window
GROUP BY program_id;Connect Metabase, Grafana, or Hex to read-only replica:
# Grafana postgres datasource -> dashboard panels on daily_volumeWhat this demonstrates:
swaps, mints, votes).| Metric | Definition | Pitfall |
|---|---|---|
| DAU | Distinct signers per day | Includes bots |
| Volume | Sum trade notional USD | Needs price oracle at time |
| Retention | Wallets active week N | Cohort key is wallet |
| Revenue | Protocol fees in SOL | Decimal conversion |
# Nightly refresh job (cron)
psql $DATABASE_URL -c "REFRESH MATERIALIZED VIEW CONCURRENTLY daily_volume;"| Alternative | Use When | Don't Use When |
|---|---|---|
| Dune/Flipside community | Public protocol stats | Private unreleased program |
| ClickHouse real-time | Billions of rows | Small MVP |
| Notebook SQL | Ad-hoc research | Customer-facing dashboards |
| Provider analytics UI | Quick launch | Custom metric definitions |
Start Postgres; migrate to BigQuery/ClickHouse when queries exceed minute-scale on replica.
Product-dependent - 1-5 min lag common for batch refresh; sub-minute needs stream aggregations.
No - dashboards read your database API, not JSON-RPC directly.
Indexer lag slots, refresh duration, row count growth, API p95 latency.
Document token price source and which accounts count as locked - ambiguous across protocols.
Use DAS-indexed tables or provider exports for cNFT mint counts.
Read-only DB roles per dashboard; no production write creds in BI tools.
Snapshot tests on fixed fixture dataset with expected aggregates.
Pre-aggregate before mint events; scale refresh frequency temporarily.
See Building an Indexer for upstream pipeline.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026