Query editor
with latest as (select blockchain,max(day) day from dune.gearbox_fi.result_ca_token_balances_by_pool_multichain group by blockchain)select b.blockchain, b.day, count(*) rows, count(distinct b.pool) pools, count(distinct b.token) tokens,count_if(b.balance_raw>0) positive_balances,count_if(b.balance_raw<0) negative_balances,count_if(b.balance_raw>0 and b.decimals is null) positive_missing_decimals,count_if(b.balance_raw>0 and b.price_usd is null) positive_missing_price,count_if(b.balance_raw>0 and b.price_usd=0) positive_zero_price,sum(b.balance_usd) priced_balance_usdfrom dune.gearbox_fi.result_ca_token_balances_by_pool_multichain bjoin latest l on b.blockchain=l.blockchain and b.day=l.daygroup by b.blockchain,b.day order by b.blockchain