Query editor
/* Success! If you're still running into issues, check out https://dune.com/docs/query/syntax-differences/ or reach out in the #dune-sql Discord channel. *//* Success! If you're still running into issues, check out https://dune.com/docs/query/syntax-differences/ or reach out in the #dune-sql Discord channel. */SELECT-- date_trunc('day', block_time) AS day,ROW_NUMBER() OVER (ORDER BYCOUNT(DISTINCT taker) DESC NULLS FIRST) AS "Rank",project,COUNT(DISTINCT taker) AS unique_users,COUNT(DISTINCT tx_hash) AS txns,SUM(amount_usd) AS usd_volumeFROM dex.tradesWHERE blockchain = 'optimism'AND block_time >= now() - INTERVAL '{{days}}' dayGROUP BY 2ORDER BY 3 DESCLIMIT 10