What is Dune Analytics?
Dune Analytics is a blockchain analytics platform. You can use it to query, visualize, and share blockchain data with SQL. Game developers can use it for:- Player analytics: Track user acquisition, retention, and engagement
- Transaction analysis: Monitor the game economy and player behavior
- Performance metrics: Measure daily and weekly active users, and transaction volumes
- Cohort analysis: Understand the 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 the SELECT, JOIN, WHERE, and GROUP BY clauses
- Contract addresses: Know your game’s smart contract addresses
- Understanding of your game logic: Know what each transaction represents in your game
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
Open the Sei Games Query Templates dashboard.Step 2: Understanding the dashboard structure
The template dashboard contains these metrics:- Total unique users
- Cohort retention analysis
- User acquisition trends
- Transaction volume analysis
- Daily and weekly active users
How to fork and use query templates
Forking a query
- To open a query, click any visualization in the dashboard.
- To open the query editor, click Edit Query or the query title.
- To fork the query, click Fork in the top right.
- Give your fork a descriptive name, such as “MyGame - Daily Active Users”.
- Replace the placeholder values with your own contract addresses.
Making queries private/public
- Private queries: Visible only to you
- Public queries: Visible to all Dune users
- Unlisted: Not searchable, but accessible through a 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 own 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 the first interaction (0 is the first week, 1 is the second week, and so on)retention_percentage: Percentage of the cohort still active
3. Weekly user acquisition
Purpose: Track how many new users you get 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 how many new users you get each day.Customizing queries for your game
1. Replace contract addresses
In each query, find this section:2. Filter by specific functions
To track specific game actions, filter by function signature:3. Add time filters
To analyze a specific period, filter by date:Best practices
Performance optimization
- Always use date filters to limit the scope of the data.
- Filter on indexed columns (block_date, address) first.
- Use
LIMITwhen you test large queries.