Query editor
-- Title: "Top Markets by Daily Volume Extended"-- Description: "Top markets across StarkNet and Ethereum by daily volume (latest snapshot per chain)."WITH latest_data AS (SELECTchain,market,CAST(openInterest AS DOUBLE) AS openInterest,CAST(dailyVolume AS DOUBLE) AS dailyVolume,CAST(lastPrice AS DOUBLE) AS lastPrice,ROW_NUMBER() OVER (PARTITION BY chain, market ORDER BY fetched_at DESC) AS rnFROM dune.vadymdi.dataset_extended_markets_dataWHERE CAST(openInterest AS DOUBLE) > 0),filtered AS (SELECTchain,market,ROUND(openInterest, 2) AS open_interest,ROUND(dailyVolume, 2) AS daily_volume,ROUND(lastPrice, 2) AS last_price,ROUND(openInterest * lastPrice, 2) AS open_interest_usd,CASEWHEN dailyVolume > 0 THEN ROUND(openInterest / dailyVolume, 2)ELSE NULLEND AS oi_to_volume_ratioFROM latest_dataWHERE rn = 1)SELECT *FROM filteredORDER BY daily_volume DESCLIMIT 30;