Query editor
withmerged as (selectcoalesce(frontend, 'unknown') as frontend,bet_id,bettor,usd_amount,usd_ggr,is_freebet,status != 'Accepted' as is_settledfrom dune.azuro.result_ordinars_combos_resolvedleft join dune.azuro.dataset_frontends using (affiliate)union allselectfrontend,bet_id,bettor,usd_amount,usd_ggr,is_freebet,bet_status != 'accepted' as is_settledfrom query_5092706 -- live: matview frozen since 2026-10-08 (storage over plan limit)where bet_id not in (-- 2026-10-06 oracle key compromise bets, same exclusion as query 5258401'0xf9548be470a4e130c90cea8b179fcd66d2972ac7_442081','0x0e00e6ffcb5e207b800eec9e02999d1fd9e448f2_6661'))selectfrontend,count(distinct bet_id) as bets_count,count(distinct bettor) as unique_users,sum(usd_amount) filter (where not is_freebet) as total_bet_amount,sum(usd_ggr) as total_ggr,sum(usd_amount) filter (where not is_freebet)/ nullif(count(distinct case when not is_freebet then bet_id end), 0) as avg_bet,approx_percentile(case when not is_freebet then usd_amount end, 0.5) as median_bet,max(usd_amount) filter (where not is_freebet) as max_bet,sum(usd_amount) filter (where not is_freebet) / count(distinct bettor) as turnover_per_user,sum(usd_ggr) / nullif(sum(usd_amount) filter (where is_settled and not is_freebet), 0) as pnlfrom mergedgroup by 1order by 4 desc