How to Track Protocol User Growth with Dune Analytics
Tracking user growth for a specific protocol with Dune is about turning the abstract concept of \"users\" into quantifiable definitions—new users, active users, or retained users. Then, start with SQL queries: understand others' code first, then tweak it to get your own data.
Step 1: Break Down \"User Growth\" into Measurable Metrics
Before writing a query, clarify what you want to see. The Dune community has accumulated many user growth templates. Core metrics usually include these dimensions:
-
New Users: Number of addresses interacting with the protocol for the first time, reflecting acquisition capability.
-
Daily/Weekly Active Users (DAU/WAU): Number of unique addresses that interacted within a specific time period, reflecting user engagement.
-
Retention Rate: The proportion of a user cohort still active after a certain period, indicating whether the product retains users.
-
Cumulative Users: Total unique users since launch, reflecting overall adoption scale.
The core logic of such queries is tofirst define \"a user's first interaction\", then aggregate by time. Dune's official documentation provides complete user growth query templates that you can fork and use.
Step 2: Where to Start—Find Existing Dashboards, Then Fork
The most effective path for beginners is to \"stand on the shoulders of others.\" Search the protocol name on Dune's Discover page; chances are someone has already built user-related dashboards.
Action Path:
-
Log into Dune and go to the Discover page.
-
Search for the protocol you want to track (e.g., Uniswap, Aave, or a new project's contract name).
-
Find a dashboard containing \"Users,\" \"Growth,\" or \"Retention\" metrics.
-
Click any chart, then click\"Edit Query\"to view the underlying SQL.
-
Click the\"Fork\"button to copy the query to your workspace.
After forking, you can modify the contract addresses or date ranges in the code to generate your own data.
Step 3: Start from a Template, Adapt to Your Protocol
Using Dune's official user growth template as an example, here's the core query structure for tracking cumulative users of a protocol:
-- Define your protocol's contract addresses (replace with yours) WITH my_protocol_contracts AS ( SELECT address FROM UNNEST(ARRAY[ 0xYOUR_CONTRACT_ADDRESS_1, -- Fill in your contract address 0xYOUR_CONTRACT_ADDRESS_2 ]) AS _u(address) ), -- Find the first time each user interacted with the contract user_first_seen AS ( SELECT t.\"from\" AS user_address, MIN(t.block_date) AS first_interaction_date FROM sei.transactions AS t JOIN my_protocol_contracts AS c ON t.\"to\" = c.address WHERE t.success = TRUE GROUP BY 1 ) -- Count new users and cumulative users by day SELECT first_interaction_date, COUNT(user_address) AS new_users, SUM(COUNT(user_address)) OVER (ORDER BY first_interaction_date) AS cumulative_users FROM user_first_seen GROUP BY 1 ORDER BY 1 DESC
Key Adjustments:
-
Replace
0xYOUR_CONTRACT_ADDRESS_1with the actual contract address of your protocol. -
Change
sei.transactionsto the corresponding chain table, e.g.,ethereum.transactionsfor Ethereum,solana.transactionsfor Solana. -
If the protocol has multiple contract addresses (e.g., factory contract + router contract), include them all in the
ARRAY.
Step 4: Advanced—Track Retention and User Quality
Simply counting total users isn't enough to gauge health; you also need retention. Dune's community queries offer the \"Quick Ratio\" metric—using (new users + resurrected users) / churned users to assess whether the user base is growing healthily.
Another metric is\"User Activity Diversity\": check whether users engage in multiple types of on-chain activities rather than repeating a single behavior. A user who both trades on a DEX and participates in liquidity mining is typically higher quality than an address that only transfers tokens.
How much data can Dune's free plan query?
The free plan offers 2,500 credits per month, enough for daily learning and light queries. Browsing public dashboards does not consume credits. Upgrading to Analyst or Plus plans is needed if you exceed the limit.
I don't know SQL; can I still track user growth with Dune?
Yes. Dune'sWand AItool, launched in 2023, allows you to describe your needs in natural language (e.g., \"Show me weekly new users for Protocol X\"), and the AI generates the SQL for you. You can also fork existing queries and only change the contract addresses without writing code from scratch.
