Query editor
-- Token universe: query_8760843 (canonical mirror of the dataland token_pegs seed).-- Never hardcode token addresses here; change the universe query instead.-- Volume rule (matches Tempo internal transfer-volume definition):-- * in_scope_for_volume tokens only (curated fiat stablecoins + price-pinned RWA);-- * USD payment stablecoins valued at par, everything else at Dune's amount_usd;-- * excludes mint/burn legs, block-level system txs (tx_from 0x0) and Fee AMM flows (tx_to 0xfeec...).-- This is GROSS onchain transfer volume. It is not customer-attributed TPV: internal TPV-- additionally carves out issuer/infra internal movements, DEX/lending legs and market makers.WITH transfers AS (SELECTtr.block_date,u.symbol,u.token_class,CASE WHEN u.price_at_par THEN tr.amount ELSE tr.amount_usd END AS value_usdFROM tokens.transfers trINNER JOIN query_8760843 uON u.contract_address = tr.contract_addressAND u.in_scope_for_volumeWHERE tr.blockchain = 'tempo'AND tr.block_month >= DATE '2026-03-01'AND tr.block_date >= DATE '2026-03-18'AND tr.block_date < current_dateAND tr."from" <> 0x0000000000000000000000000000000000000000AND tr."to" <> 0x0000000000000000000000000000000000000000AND (tr.tx_from IS NULL OR tr.tx_from <> 0x0000000000000000000000000000000000000000)AND (tr.tx_to IS NULL OR tr.tx_to <> 0xfeec000000000000000000000000000000000000)),days AS (SELECT CAST(timestamp AS date) AS dayFROM utils.daysWHERE timestamp >= DATE '2026-03-18'AND timestamp < current_date),daily AS (SELECT block_date AS day, SUM(value_usd) AS daily_volume_usdFROM transfersGROUP BY 1),series AS (SELECT d.day, COALESCE(v.daily_volume_usd, 0) AS daily_volume_usdFROM days dLEFT JOIN daily v ON d.day = v.day),rolling AS (SELECTday,daily_volume_usd,SUM(daily_volume_usd) OVER (ORDER BY day ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS rolling_30d_volume_usd,COUNT(*) OVER (ORDER BY day ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS days_in_windowFROM series), ranked_window_days AS (SELECTr.day AS window_end,s.day AS volume_day,s.daily_volume_usd,ROW_NUMBER() OVER (PARTITION BY r.dayORDER BY s.daily_volume_usd DESC, s.day ASC) AS volume_rank