Query editor
-- 2026-11-21: source switched from matview dune.ondo_team.result_ondo_assets_price_history to the plain query_6750841-- (ondo_assets_price_history). The matview and its daily schedule were deleted (~0.3k credits/month);-- query_6750841 now runs inline (GM API http_get for all assets, ~10 credits). Logic unchanged.-- To go back: recreate the matview on 6750841 and swap query_6750841 back to dune.ondo_team.result_ondo_assets_price_history.with gm_px as (select symbol, max_by(price, day) price from query_6750841 where price is not null and day >= current_date - interval '14' day group by 1),t as (select 'ethereum' blockchain, a.address contract_address, p.price px from dune.ondo_team.result_ondo_assets a join gm_px p on p.symbol = a.symbol where a.symbol <> 'USDon' and a.address is not nullunion allselect 'bnb', a.address_bnb, p.price from dune.ondo_team.result_ondo_assets a join gm_px p on p.symbol = a.symbol where a.symbol <> 'USDon' and a.address_bnb is not null),x as (select 'ethereum' blockchain, contract_address, "from", "to", value from erc20_ethereum.evt_transferwhere evt_block_date >= date '2025-07-01' and contract_address in (select contract_address from t where blockchain = 'ethereum')union allselect 'bnb', contract_address, "from", "to", value from erc20_bnb.evt_transferwhere evt_block_date >= date '2025-10-01' and contract_address in (select contract_address from t where blockchain = 'bnb')),d as (select blockchain, contract_address, "to" wallet, cast(value as double) v from xunion all select blockchain, contract_address, "from", -cast(value as double) from x),bal as (select d.wallet, d.blockchain, sum(v)/1e18 * max(t.px) usdfrom d join t on t.blockchain = d.blockchain and t.contract_address = d.contract_addresswhere d.wallet <> 0x0000000000000000000000000000000000000000group by d.wallet, d.blockchain, d.contract_address)select lower(cast(wallet as varchar)) wallet, sum(usd) gm_usd, array_join(array_agg(distinct blockchain), ',') chainsfrom bal where usd > 0.01 group by 1 having sum(usd) >= 1000 order by 2 desc