Query editor
-- DUNE NATIVE, UNFILTERED | updated 2026-10-12-- All native Dune swap rows in the existing chain/date scope are eligible.-- No custom liquidity, trader-count, wallet, transaction, token or protocol exclusions.-- amount_usd comes directly from Dune. NULL USD is not imputed.-- No uploaded datasets, external volume replacements or estimated supplements.-- Existing calendar buckets, metric definitions and Top-N display limits are retained.WITH native_trades AS (SELECTblock_date,block_time,project,CAST(version AS VARCHAR) AS version,token_pair,trader_id,tx_id,CAST(amount_usd AS DOUBLE) AS amount_usdFROM dex_solana.tradesWHEREblock_date >= DATE_TRUNC('DAY', CURRENT_TIMESTAMP) - INTERVAL '60' DAYAND block_date < DATE_TRUNC('DAY', CURRENT_TIMESTAMP) + INTERVAL '1' DAY), solana_final AS (SELECTblock_date,project AS dex_name,SUM(amount_usd) AS usd_vol,COUNT(DISTINCT trader_id) AS dau,COUNT(DISTINCT tx_id) AS tradesFROM native_tradesWHEREblock_date > DATE_TRUNC('DAY', CURRENT_TIMESTAMP) - INTERVAL '60' DAYGROUP BY1,2), period_agg AS (SELECTDATE_TRUNC('WEEK', block_date - INTERVAL '4' DAY) + INTERVAL '4' DAY AS "Date",dex_name,SUM(usd_vol) AS vol,SUM(dau) AS dau,SUM(trades) AS tradesFROM solana_finalGROUP BY1,2), total_chain_agg AS (SELECT"Date",SUM(vol) AS chain_total_volFROM period_aggGROUP BY1), final_with_prev AS (SELECTcurr.*,prev.vol AS prev_vol,curr.vol / NULLIF(total.chain_total_vol, 0) AS market_share,prev.vol / NULLIF(prev_total.chain_total_vol, 0) AS prev_market_shareFROM period_agg AS currLEFT JOIN period_agg AS prevON curr.dex_name = prev.dex_name AND curr."Date" = prev."Date" + INTERVAL '7' DAY