Build a blockchain data analytics framework covering on-chain data extraction, transformation, dashboard creation, and insight generation.
## ROLE
You are a blockchain data analyst who has built analytics pipelines for 20+ protocols. You work with Dune Analytics, custom subgraphs, and raw node data to extract actionable insights from on-chain activity.
## OBJECTIVE
Design a complete analytics framework for monitoring and analyzing on-chain data for your protocol or blockchain project.
## TASK
**STEP 1: ANALYTICS REQUIREMENTS**
| Category | Key Questions to Answer |
|----------|----------------------|
| User Behavior | How many DAU/WAU/MAU? What are retention rates? |
| Protocol Revenue | Total fees, revenue per user, revenue growth? |
| Liquidity | TVL trends, liquidity depth, capital efficiency? |
| Token Metrics | Holder distribution, velocity, concentration? |
| Governance | Participation rates, delegate activity, proposal outcomes? |
**STEP 2: DATA SOURCE MAPPING**
| Data Need | Source | Method | Update Frequency |
|-----------|--------|--------|-----------------|
| Transaction data | RPC node / Etherscan | Direct query / API | Real-time |
| Event logs | Subgraph / indexer | GraphQL | Block-by-block |
| Token transfers | ERC-20 Transfer events | Event indexing | Real-time |
| DeFi positions | Protocol contracts | Multicall reads | Hourly |
| Price data | Chainlink / DEX | Oracle / pool reads | Per block |
| Off-chain data | APIs / databases | REST / SQL | Varies |
**STEP 3: ANALYTICS STACK**
| Layer | Tool Options | Recommendation |
|-------|-------------|---------------|
| Indexing | The Graph, Goldsky, Ponder | Based on {blockchain} |
| Querying | Dune, Flipside, custom SQL | Based on complexity |
| Visualization | Dune dashboards, Grafana, custom | Based on audience |
| Alerting | OpenZeppelin Defender, custom | Based on urgency |
| Storage | PostgreSQL, ClickHouse, BigQuery | Based on volume |
**STEP 4: KEY DASHBOARDS**
Design these standard dashboards:
1. **Protocol Overview**: TVL, users, revenue, growth rates
2. **User Analytics**: New vs returning, cohort analysis, activity heatmaps
3. **Financial Dashboard**: Revenue, expenses, treasury health
4. **Token Dashboard**: Price, supply, holder stats, distribution
5. **Security Monitor**: Unusual transactions, large transfers, contract interactions
**STEP 5: REPORTING CADENCE**
- Daily automated reports (key metrics email/Discord)
- Weekly analytics summary for team
- Monthly deep-analysis report for governance
- Quarterly strategic review with trend analysis
## INPUT
**Project Name**: {project_name}
**Blockchain**: {blockchain}
**Key Contracts**: {contract_addresses}
**Primary Analytics Goals**: {analytics_goals}
**Technical Skill Level**: {skill_level}Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{blockchain}{project_name}{contract_addresses}{analytics_goals}{skill_level}