Query editor
with buckets as (select * from (values(0, 100, '0-100'),(100, 1000, '100-1k'),(1000, 10000, '1k-10k'),(10000, 50000, '10k-50k'),(50000, 100000, '50k-100k'),(100000, 1e30, '100k+')) as a (lower, upper, desc)), holders as (selectt.wallet_address,sum(cast(t.amount_raw as decimal))/1e18 * i.price notionalfrom transfers_base.erc20 tjoin query_3557966 i on i.block_date = current_datewhere t.token_address = 0xEcE7B98bD817ee5B1F2f536dAf34D0B6af8Bb542-- exclude Uniswap LPand t.wallet_address <> 0x6d33206adB1462992C642BA5dD4F4e16bEb4D047group by t.wallet_address, i.pricehaving sum(cast(t.amount_raw as decimal))/1e18 > 1)select b.desc notional, b.lower, count(distinct h.wallet_address) "count"from holders hjoin buckets b on h.notional between b.lower and b.uppergroup by b.desc, b.lowerorder by b.lower