Sub topic 14
Designing a dashboard people can trust
This chapter covers the design decisions that make a finished dashboard believable. It assumes you can write DuneSQL queries and parameters, build Dune charts, read DefiLlama's TVL, volume, fees and stablecoin pages, and call its public API. It also assumes you know the pitfalls from earlier chapters: token decimals, double counting and price assumptions. You also need the cross-checking habit from the previous chapter.
A dashboard can have correct SQL and still mislead. Readers can't see your queries, so they judge the dashboard by what is on the page. The aim is for every number to answer three questions without the reader asking: what does this measure, how fresh is it, and how was it checked.
Start from a decision, not a dataset
Dashboards fail most often because they show whatever was easy to query. Before writing SQL, write one sentence that names the reader and the question.
- Weak: "DEX stats."
- Better: "Is Ethereum DEX volume concentrated in a few projects, and is that changing over 30 days?"
The sentence limits the dashboard. Each chart must help answer the question, or you remove it. A tight dashboard also has fewer numbers to defend.
For each chart, record:
- The metric. For example, USD trading volume from
dex.trades. - The grain. One row per day per project.
- The source. A Dune curated table, DefiLlama's API, or both.
- The known gaps. Trades with no USD price, chains not covered, and so on.
You will reuse this record in the notes section described later.
A layout that supports reading
Put the headline numbers at the top, trends under them, and breakdowns and detail tables at the bottom. Readers scan top to bottom, so the answer should come first and the evidence after it.
Some layout rules:
- Label every number with its window. "Volume (last 30 days)" is better than "Volume".
- Use units in titles. Write "USD" and "billions" in the title, so readers don't have to infer the unit from the axis.
- Keep one question per chart. If a chart needs a paragraph to explain, split it.
- Choose chart types for the data. Use lines for time series, stacked bars for composition over time, and tables for exact values. Avoid pie charts with more than five slices.
- Order and cap categories. Show the top 10 projects and group the rest as "Other". Otherwise the legend becomes unreadable and colors repeat.
Show freshness explicitly
Dune results reflect the last time the query ran. A dashboard that was refreshed three days ago and looks current is a trust problem. Add a small query whose only job is to report data freshness, and give it a counter visualization.
SELECT
max(time) AS latest_block_time,
date_diff('minute', max(time), now()) AS minutes_behind
FROM ethereum.blocks
WHERE time >= now() - INTERVAL '1' DAYThe filter on time lets the engine prune old data. Without it, max(time) scans the full table. Put this counter near the top of the page. Also set a refresh schedule for the dashboard queries that matches how the reader uses the page. A weekly report does not need hourly refreshes, and hourly refreshes use credits.
The curated tables can lag behind the raw chain. If dex.trades is slower than ethereum.blocks, your chart is only as fresh as dex.trades. For the most accurate indicator, check the latest block_time in the table that the chart actually uses.
Expose data quality, not just results
Several pitfalls from earlier chapters can be measured. Measure them and put them on the page. A reader who sees "2.1% of trades have no USD price" trusts you more than one who sees nothing.
SELECT
block_date,
COUNT(*) AS trades,
COUNT_IF(amount_usd IS NULL) AS trades_without_price,
CAST(COUNT_IF(amount_usd IS NULL) AS double) / COUNT(*) AS share_without_price
FROM dex.trades
WHERE blockchain = 'ethereum'
AND block_date >= current_date - INTERVAL '30' DAY
GROUP BY 1
ORDER BY 1Plot share_without_price as a small line chart below the volume chart. If the share spikes, a dip in volume may be a pricing gap and not a real change in trading.
Other checks that are worth showing as counters or small tables:
- Row counts per day. A sudden drop to zero usually means a pipeline or filter problem.
- Largest single item. Display the biggest trade or transfer for the period. One outlier can dominate a daily total, and readers should be able to see that.
- Share of volume from the top project. It makes concentration visible and flags wash trading or a single bot.
Parameters: flexibility with guardrails
Parameters let one query serve many views, as in the {{blockchain}} example from the earlier chapter:
SELECT
block_date,
project,
SUM(amount_usd) AS volume_usd
FROM dex.trades
WHERE blockchain = '{{blockchain}}'
AND block_date >= current_date - INTERVAL '30' DAY
GROUP BY 1, 2
ORDER BY 1, 3 DESCParameters create trust problems of their own:
- Free text invites typos. A reader who types
Ethereuminstead ofethereumgets an empty chart and may conclude there was no activity. Use a list parameter with fixed values where Dune allows it. - Defaults must be sensible. The dashboard should load with a meaningful view and not an empty one.
- Titles should react to the parameter. If the chart changes with the chain, say which chain is shown. Otherwise screenshots lose their context.
- Shared parameters must mean the same thing everywhere. If one query's
{{blockchain}}filtersdex.tradesand another's filters a different table that names chains differently, the dashboard silently mixes views. Check the naming of the column in every table you filter.
Build cross-checks into the dashboard
The previous chapter compared Dune and DefiLlama by hand. For a dashboard you maintain, turn the comparison into a repeatable check and publish the result. The script below fetches current TVL for a protocol from DefiLlama's /protocols endpoint and compares it to a number you supply from your own Dune query.
import sys
import requests
def defillama_tvl(name: str) -> float:
resp = requests.get("https://api.llama.fi/protocols", timeout=30)
resp.raise_for_status()
for p in resp.json():
if p.get("name", "").lower() == name.lower() and p.get("tvl") is not None:
return float(p["tvl"])
raise ValueError(f"protocol not found: {name}")
def compare(name: str, dune_value: float, tolerance: float = 0.05) -> bool:
reference = defillama_tvl(name)
diff = abs(dune_value - reference) / reference
print(f"{name}: dune=${dune_value:,.0f} defillama=${reference:,.0f} diff={diff:.1%}")
return diff <= tolerance
if __name__ == "__main__":
ok = compare(sys.argv[1], float(sys.argv[2]))
sys.exit(0 if ok else 1)Run it as python check_tvl.py "Aave V3" 12500000000, replacing the number with your Dune result. Names in the API must match exactly, apart from case, so check the spelling against the DefiLlama site first.
Choose the tolerance on purpose. Differences of a few percent are normal when the sources use different price timestamps or token lists. A difference of 30% means the definitions differ, such as TVL that includes borrowed assets, or a missing chain. Record the reason in the notes, as the previous chapter taught. Don't widen the tolerance until the check passes.
Write the notes section
Put a text widget at the bottom of every dashboard. It should contain:
- Definitions. For example, "Volume is the USD value of swaps in
dex.trades, counted once per trade." - Sources. Name the tables, the DefiLlama endpoints, and the date you last checked them.
- Known gaps. For example, "Trades with no available price are excluded from USD volume."
- Comparison result. For example, "Our Ethereum TVL is within 3% of DefiLlama as of the last check. Differences come from price timing."
- An owner and a way to report errors. A name or handle makes the dashboard accountable.
Common failure modes
| Problem | How readers experience it | Fix |
|---|---|---|
| Stale results | Numbers look current but are days old | Freshness counter and refresh schedule |
| Hidden price gaps | Volume dips with no explanation | Show the share of unpriced rows |
| Unit confusion | A chart in raw token units sits next to USD charts | Put units in every title |
| Double counting | Totals exceed what the source reports | Add a cross-check and state the counting rule |
| Cherry-picked window | A trend vanishes with a longer range | Show at least two windows, such as 30 and 365 days |
| Overloaded page | Readers miss the key chart | Limit the page to one question |
| Unowned dashboard | Errors persist after being noticed | Name an owner in the notes |
Reviewing before you publish
Before sharing a dashboard, check it in this order:
- Reload it with the default parameters and confirm every chart renders.
- Change each parameter to a second value and confirm the charts still make sense.
- Check three numbers against an independent source, either DefiLlama or a block explorer.
- Read the page as someone who has never seen it. Each title should state a metric, a unit and a window.
- Open the page on a narrow screen. Wide tables and long legends often break.
Exercise
Your Dune dashboard shows Ethereum DEX volume dropping by 40% for one day, and the daily row count in dex.trades looks normal. Name two additional checks you would add to the dashboard to decide whether the drop is real, and say what each result would tell you.
Show answer
First, add the share of trades with a NULL amount_usd per day. If it spikes on the day of the drop, the dip comes from missing prices and not from trading. Second, add the largest single trade or the top project's share of volume for the period, or compare the same day against DefiLlama's DEX volume. If a very large trade or bot activity inflated the previous days, the drop is a return to normal. If DefiLlama shows a similar drop, the move is probably real.
Exercise
A reader types Ethereum into a free-text {{blockchain}} parameter and sees an empty chart. List two changes that prevent this from misleading them.
Show answer
Replace the free-text parameter with a list parameter that only offers valid values such as ethereum, and set a default value so the dashboard loads with data. Optionally, add a row-count counter or a chart title that shows the selected chain, so an empty result is visible as "no rows" and not read as "no activity".