Query editor
with evm as (select coalesce(g.wallet, r.wallet) wallet,coalesce(g.gm_usd, 0) gm_usd, coalesce(r.ousg_usd, 0) ousg_usd, coalesce(r.usdy_usd, 0) usdy_usdfrom dune.ondo_team.result_ondo_gm_evm_wallet_balances gfull outer join query_9011033 r on r.wallet = g.wallet),sol as (select wallet, gm_usd, ousg_usd, usdy_usd from query_9011030),w as (select wallet, gm_usd, ousg_usd, usdy_usd, gm_usd + ousg_usd + usdy_usd total_usd, 'evm' fam from evmunion allselect wallet, gm_usd, ousg_usd, usdy_usd, gm_usd + ousg_usd + usdy_usd, 'solana' from sol),th (threshold) as (values 1000000, 900000, 800000, 700000, 600000, 500000, 400000, 300000, 200000, 100000, 80000, 60000, 40000, 20000)select th.threshold,count_if(w.total_usd > th.threshold) wallets_any_combined,count_if(w.gm_usd > th.threshold) wallets_gm,count_if(w.ousg_usd > th.threshold) wallets_ousg,count_if(w.usdy_usd > th.threshold) wallets_usdy,count_if(w.total_usd > th.threshold and w.fam = 'evm') combined_evm,count_if(w.total_usd > th.threshold and w.fam = 'solana') combined_solanafrom th cross join wgroup by 1 order by 1 desc