What is Dune Analytics?
Dune Analytics is a powerful blockchain analytics platform that allows you to query, visualize, and share blockchain data using SQL. For game developers, it’s an invaluable tool for:- Player Analytics: Track user acquisition, retention, and engagement
- Transaction Analysis: Monitor game economy and player behavior
- Performance Metrics: Measure daily/weekly active users, transaction volumes
- Cohort Analysis: Understand player lifecycle and retention patterns
- Custom Dashboards: Create visual reports for stakeholders
Key Features:
- SQL-based querying interface
- Pre-indexed blockchain data from multiple networks
- Visualization tools for charts and dashboards
- Real-time data updates
Prerequisites
Before you begin, make sure you have:- Dune Account: Sign up at dune.com
- Basic SQL Knowledge: Understanding of SELECT, JOIN, WHERE, GROUP BY clauses
- Contract Addresses: Know your game’s smart contract addresses
- Understanding of Your Game Logic: Know what transactions represent in your game context
SQL Knowledge Requirements:
- Basic
SELECTstatements - JOINs (
INNER,LEFT) - Aggregate functions (
COUNT,SUM,AVG) - Date functions (
DATE_TRUNC,DATE_DIFF) - Common Table Expressions (
WITHclauses)
Getting Started
Step 1: Access the Template Dashboard
Visit the Sei Games Query Templates: Game Query TemplatesStep 2: Understanding the Dashboard Structure
The template dashboard contains several key metrics:- Total unique users
- Cohort retention analysis
- User acquisition trends
- Transaction volume analysis
- Daily/Weekly active users
How to Fork and Use Query Templates
Forking a Query
- Navigate to the Query: Click on any visualization in the dashboard
- Access Query Editor: Click “Edit Query” or the query title
- Fork the Query: Click the “Fork” button in the top right
- Rename Your Fork: Give it a descriptive name like “MyGame - Daily Active Users”
- Customize: Replace placeholder values with your actual contract addresses
Making Queries Private/Public
- Private Queries: Only visible to you
- Public Queries: Visible to all Dune users
- Unlisted: Not searchable but accessible via direct link
Query Templates for Game Analytics
1. Total Unique Users
Purpose: Get the total number of unique players who have ever interacted with your game.- Replace
0xYOUR_CONTRACT_ADDRESS_1with your actual contract addresses - Add or remove addresses as needed
2. Cohort Retention Analysis
Purpose: Analyze how well you retain players over time by tracking weekly cohorts.cohort_week: When users first joinedweek_offset: Weeks since first interaction (0 = first week, 1 = second week, etc.)retention_percentage: Percentage of cohort still active
3. Weekly User Acquisition
Purpose: Track how many new users you’re acquiring each week.4. Daily Transaction Volume
Purpose: Monitor daily transaction activity in your game.5. Daily Active Users (DAU)
Purpose: Track unique daily active users.6. Weekly Transaction Volume
Purpose: Analyze weekly transaction patterns.7. Weekly Active Users (WAU)
Purpose: Track unique weekly active users.8. Daily User Acquisition
Purpose: Track new user acquisition on a daily basis.Customizing Queries for Your Game
1. Replace Contract Addresses
Find this section in each query:2. Filter by Specific Functions
To track specific game actions, add function signature filtering:3. Add Time Filters
To analyze specific periods:Best Practices
Performance Optimization
- Use Date Filters: Always include date ranges to limit data scope
- Index Awareness: Filter on indexed columns (block_date, address) first
- Limit Results: Use
LIMITfor testing large queries