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. */SELECT-- date_trunc('day', block_time) AS day,ROW_NUMBER() OVER (ORDER BYCOUNT(DISTINCT taker) DESC NULLS FIRST) AS "Rank",project,blockchain,COUNT(DISTINCT taker) AS unique_users,COUNT(DISTINCT tx_hash) AS txns,SUM(amount_usd) AS usd_volumeFROM dex.tradesWHERE blockchain IN ('ethereum','polygon','arbitrum','optimism')AND block_time >= now() - INTERVAL '{{days}}' dayGROUP BY 2,3ORDER BY 4 DESCLIMIT 10