Query editor
-- 02 · Monthly notional volume by theme, sub-theme and venue (partial current month excluded)-- Reads the classifier: https://dune.com/queries/9226505with mk as (select theme, sub_theme, venue, market_idfrom query_9226505where not looks_like_price_market)selectdate_trunc('month', o.hour) as month,mk.theme,mk.sub_theme,o.venue,sum(o.volume_contracts) as volume_notional_usd,sum(case when o.vwap between 0.10 and 0.90 then o.volume_contracts end) as volume_notional_10_90c_usd,sum(o.volume_usd) as volume_cash_usd,count(distinct o.market_id) filter (where not o.is_forward_filled) as markets_traded,sum(o.trade_count) as trade_countfrom prediction_markets.ohlcv_hourly ojoin mk on mk.venue = o.venue and mk.market_id = o.market_idwhere o.block_month >= date '2022-01-01'and o.hour < cast(date_trunc('month', current_date) as timestamp)group by 1, 2, 3, 4order by 1, 2, 3, 4