Skip to main content

Dune Analytics: Build Custom Dashboards

Step-by-step Dune Analytics guide for building crypto dashboards: SQL basics, decoded tables, parameters, and publishing to the public catalog in 2026.

Written by Eco


Dune Analytics is a SQL-native onchain analytics platform that lets users query decoded blockchain data and publish results as public dashboards. This Dune Analytics tutorial walks through the core workflow: connecting to the data, writing a first query, building a dashboard, parameterizing it, and sharing it with the community. Everything in this guide works on the free tier as of 2026.

The reason Dune dominates the SQL-native category is reach. Over 1 million queries have been published, the community-maintained spellbook decodes most major protocols, and the platform covers 100+ chains with full transaction and event data. If a protocol matters and lives onchain, someone has likely already written a starter query.

What Is Dune Analytics?

Dune is a hosted data warehouse with a SQL editor on top. Underneath, it stores decoded EVM (and now Solana, Bitcoin, and others) blockchain data in a columnar database — historically PostgreSQL, now Trino-based as of 2024. Users write SQL against tables like ethereum.transactions, uniswap_v3_ethereum.Pair_evt_Swap, and tokens.erc20. Results render as tables, charts, or counters that compose into dashboards.

The free tier is generous: unlimited queries with up to 10-minute execution delays, public dashboards, and basic export. Paid tiers — Plus at $399/month and Premium at $999/month — unlock private content, faster execution, larger results, and the API.

How Dune's Data Model Works

Two layers matter: raw and decoded.

Raw tables mirror what nodes export. ethereum.transactions, ethereum.blocks, ethereum.logs, and ethereum.traces contain the full unprocessed history. Querying raw tables works for any contract on the chain, but you need to decode logs yourself.

Decoded tables are populated by the spellbook. When a contract is verified and added, every event becomes its own table — uniswap_v3_ethereum.Factory_evt_PoolCreated, aave_v3_ethereum.Pool_evt_Borrow, etc. Querying decoded tables is much faster and clearer than parsing raw logs.

The naming convention is: {protocol}_{chain}.{Contract}_evt_{EventName} for events and _call_{FunctionName} for function calls. Aggregated tables — dex.trades, nft.trades, tokens.transfers — combine sources across protocols.

Step 1: Set Up an Account

Sign up at dune.com/auth/register. The free tier is enough to follow this guide. Connect a Discord account if you want to participate in the spellbook contributor community — the contributor reputation system is how new contracts get decoded.

From the home page, click "Queries" → "+ New Query" to open the SQL editor.

Step 2: Write the First Query

Run a basic query to count Ethereum transactions in the last 24 hours.

SELECT COUNT(*) AS tx_count
FROM ethereum.transactions
WHERE block_time >= NOW() - INTERVAL '1' DAY

Click "Run" or hit Cmd+Enter. The result appears below — typically around 1.0–1.4 million transactions per day on Ethereum mainnet in 2026. Save the query with a name like "Ethereum daily tx count."

The query took 5–30 seconds depending on warehouse load. Free-tier queries run in a shared cluster; paid tiers get faster lanes.

Step 3: Query Decoded Protocol Data

The real power is in decoded tables. Pull the top 10 Uniswap v3 pools by 24h volume on Ethereum.

SELECT pool, SUM(amount_usd) AS volume_24h
FROM dex.trades
WHERE blockchain = 'ethereum'
AND project = 'uniswap'
AND version = '3'
AND block_time >= NOW() - INTERVAL '1' DAY
GROUP BY pool
ORDER BY volume_24h DESC
LIMIT 10

This uses dex.trades, a Dune-curated table that aggregates trades across DEX protocols. Behind the scenes, the spellbook joins decoded Swap events from Uniswap v3, Curve, Balancer, etc., normalizes amounts to USD using price feeds, and exposes the result as a single table.

Step 4: Add a Visualization

After running a query, click "+ New visualization." Pick "Bar chart" for the top-10 pools query, set the x-axis to pool and y-axis to volume_24h, and save. The chart auto-updates whenever the query refreshes.

Charts available: bar, line, area, scatter, pie, counter, table. For dashboards, counters work well for headline metrics ("Total volume today"); line charts show trend; bar charts show comparison.

Step 5: Build a Dashboard

From the home page, click "Dashboards" → "+ New dashboard." Drag in any visualization from your saved queries. Layout is grid-based — resize and reorder visuals freely. Add text widgets for headers and explanation.

A useful starting structure for a protocol dashboard:

  • Header text: protocol name, link, last-updated note

  • Counters: TVL, 24h volume, 24h fees, active users

  • Line chart: TVL over time

  • Line chart: daily volume

  • Bar chart: top pools or top users

  • Table: recent large transactions

For a public reference, see Lido's treasury dashboard or hagaetc's DEX metrics. Both use this pattern.

Step 6: Parameterize the Dashboard

Parameters let users filter without editing SQL. In the query editor, replace a hardcoded value with ########{{parameter_name}}.

SELECT pool, SUM(amount_usd) AS volume
FROM dex.trades
WHERE blockchain = '########{{blockchain}}'
AND block_time >= NOW() - INTERVAL '########{{days}}' DAY
GROUP BY pool ORDER BY volume DESC LIMIT 10

Dune detects the parameters and adds them as dropdowns above the query. On the dashboard, parameters become widgets users can change. This is how cross-chain comparisons get built without duplicating queries.

Step 7: Publish and Share

Set the dashboard to public from the settings panel. Public dashboards get a permanent URL like dune.com/your-name/dashboard-slug. Share that URL anywhere. Free-tier dashboards are always public; paid tiers can be private.

Public dashboards rank in Dune's discovery feed. Quality dashboards with good titles and descriptions can pick up thousands of monthly views — Dune's popular dashboards page lists the top performers.

Tips for Better Queries

Five practical patterns that separate good Dune dashboards from slow ones.

Filter by block_time first. Time-range filters are the cheapest way to limit the warehouse scan. Always include them.

Use decoded tables over raw.uniswap_v3_ethereum.Pair_evt_Swap is faster and cleaner than parsing ethereum.logs manually.

Reuse Dune-curated tables.dex.trades, nft.trades, tokens.transfers are pre-aggregated. They save you from joining and normalizing.

Cache expensive joins. If a query takes >60 seconds, materialize intermediate results into a saved query and reference it from a faster downstream query.

Steal from public dashboards. Click "Fork" on any public query to copy and modify. Most working dashboards started as forks.

Dune's Place in the Analytics Stack

Most teams that use Dune use it alongside other tools. Common combinations:

Dune + DeFiLlama. DeFiLlama for free aggregate context (sector TVL, stablecoin supply, chain-level metrics), Dune for custom queries against specific protocols. Most independent analysts run this combo.

Dune + Nansen. Dune for SQL-driven research, Nansen for wallet-level signals. Trading-focused analysts use both — Nansen surfaces what's happening at the wallet level, Dune lets them dig into the underlying protocol activity.

Dune + Allium. Dune for ad-hoc research and prototyping, Allium for production. Teams that mature past the Dune-only stage often migrate their production queries to Allium while keeping Dune for new analysis.

Dune + custom indexer. For protocol-specific metrics that require deep customization, teams build their own indexer (Goldsky, Ponder, The Graph) on top of which Dune handles broader context.

The platform's open community model means most successful Dune dashboards started by forking someone else's work. Search the public dashboard catalog before writing from scratch.

Spellbook Contributions and Forking

The Dune spellbook is the open-source repo where decoding logic, abstractions, and curated tables are maintained. Anyone can submit a pull request adding a new protocol's decoded events or a new aggregated table.

The contribution flow:

  1. Fork the spellbook repo.

  2. Add the protocol's contract addresses and ABI under contracts/.

  3. Write the dbt model for the decoded event tables.

  4. Add tests under tests/ validating that the decoded values match a known transaction.

  5. Submit the PR. Maintainers review and merge.

Once merged, the new tables become available to all Dune users. The spellbook is one of the few open-source projects in onchain analytics with broad participation — protocol teams contribute their own decoding to ensure correctness, and analysts contribute aggregated tables for common queries.

Contribution incentives are mostly reputational. Some bounty programs exist (Dune Wars, paid contracts) but the bulk of contributions are by analysts and protocol teams who benefit from their data being accessible.

Decoded Tables: A Deeper Look

The decoded tables are where Dune separates from raw blockchain RPC. Understanding the schema makes queries faster and clearer.

Event tables. For each contract event, Dune creates {protocol}_{chain}.{Contract}_evt_{EventName}. Uniswap v3's Swap event becomes uniswap_v3_ethereum.Pair_evt_Swap. Columns include all the event's indexed and non-indexed parameters, plus standard metadata: evt_block_time, evt_tx_hash, evt_block_number, contract_address.

Function-call tables. For function calls, the pattern is {Contract}_call_{FunctionName}. These tables are populated by tracing contract calls — they include internal calls that don't emit events. Useful for tracking flows that aren't logged.

Aggregated tables. Dune-curated tables that union events across protocols. dex.trades aggregates swap events from Uniswap, Curve, Balancer, PancakeSwap, etc. tokens.transfers unions ERC-20 Transfer events across chains. nft.trades aggregates NFT marketplace trades.

Token tables.tokens.erc20 contains token metadata (name, symbol, decimals, contract address). prices.usd contains token prices indexed by minute or hour. Both are reference tables — you JOIN against them rather than query them directly.

For full table catalogs, see Dune's data catalog docs.

Common Patterns in Public Dashboards

Studying high-traffic public Dune dashboards reveals recurring patterns worth copying.

The protocol-overview dashboard. Headline counters (TVL, daily volume, active users), a TVL trend line, a top-pools/top-users table, and recent activity. Uniswap Foundation's v3 dashboard follows this exact shape. Most protocol-team dashboards do.

The chain-overview dashboard. Daily transactions, daily active addresses, gas spent, and protocol leaderboard. 0xKofi's Base stats is a clean example. Chain teams use this format for ecosystem reports.

The flow-tracking dashboard. Inflows, outflows, and net flow for an entity (DEX, bridge, treasury). The CCTP tracker dashboards on Dune use this pattern — burn events on origin chains, mint events on destination chains, joined and visualized as a flow map.

The leaderboard. Ranked list of wallets, contracts, or pools by some metric — most volume, highest PnL, biggest holders. Top dashboards keep this kind of view fresh by parameterizing the time window.

Working with Dune SQL: Common Pitfalls

Five mistakes that recur in new Dune queries.

Forgetting the time filter. Without a WHERE block_time >= ... clause, the warehouse scans the full chain history. A query against ethereum.transactions without a time filter scans 2 billion+ rows. Always include a time filter.

Mixing chain-native and wrapped tokens. Querying tokens.transfers for "USDC" on Avalanche returns both native USDC and bridged USDC.e. The contract_address column is the disambiguation — filter by the exact address.

Joining on the wrong key. CCTP transfers join on nonce, not transaction hash. Bridge stitching often fails when analysts use the natural-looking key (tx hash) instead of the protocol-specified key (message ID, nonce, etc.).

Ignoring price-feed gaps. When a token isn't in prices.usd, the JOIN returns NULL and the row gets a NULL USD value. Aggregation skips NULLs silently — the chart underreports without warning. Use COALESCE or filter explicitly.

Not testing on a small subset first. A complex query on the full 30-day window can take 5+ minutes. Test on a 1-day or 1-hour window to iterate fast, then expand the range when the logic is correct.

Eco's Role

Dune dashboards make stablecoin flows visible. Teams running stablecoin payments through Eco often build a Dune dashboard to monitor execution: USDC transfers per chain, route success rates, settlement latency. Eco's onchain transactions appear in standard decoded tables (tokens.transfers, chain-specific transaction tables) within minutes of execution. For a related view of stablecoin tracking, see our stablecoin onchain analytics guide.

FAQ

Do I need to know SQL to use Dune?

For viewing existing dashboards, no — most are public and interactive. For building your own queries, basic SQL (SELECT, WHERE, GROUP BY, JOIN) is enough to start. Dune's tutorial docs cover the basics. Forking existing queries and modifying them is the fastest path.

How fresh is Dune's data?

Decoded tables typically lag the chain tip by 5–10 minutes on the free tier. Paid tiers see lag closer to 1–2 minutes. Real-time analytics (sub-second) are not the design goal — for that, use a streaming product like Allium streams.

Can I add a new protocol to Dune?

Yes — submit a pull request to the spellbook repo with the contract addresses and decoding logic. Dune contributors review and merge. Decoded tables become available to all users once merged.

Does Dune have an API?

Yes, on paid tiers. The Dune API lets you trigger query runs, fetch results, and pipe data into external systems. The free tier does not include API access.

What chains does Dune cover?

Ethereum mainnet, Solana, Bitcoin, Base, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche, zkSync, Linea, Scroll, Mantle, Blast, and 100+ others. The full list is at docs.dune.com/data-catalog. Coverage depth varies — Ethereum has the most decoded protocols.

Did this answer your question?