Updated 2023-01-23
    select
    case when current_bal > 1000000 then 'a. >1M DYDX'
    when current_bal between 100000 and 1000000 then 'b. 100k-1M DYDX'
    when current_bal between 10000 and 100000 then 'c. 10k-100k DYDX'
    when current_bal between 1000 and 10000 then 'd. 1k-10k DYDX'
    when current_bal between 100 and 1000 then 'e. 100-1k DYDX'
    when current_bal between 10 and 100 then 'f. 10-100 DYDX'
    else 'g. <10 DYDX' end as dydx_holdings,
    count(distinct user_address) as users
    from ethereum.core.ez_current_balances
    where symbol='DYDX' and token_name='dYdX'
    --where contract_address= lower('0x92D6C1e31e14520e676a687F0a93788B716BEff5')
    and user_address not in (select address from ethereum.core.dim_labels where address_name is not null) -- avoiding treasury wallet
    and current_bal is not null and current_bal >0
    and current_bal<200000000
    -- and user_address='0x4621b8138830982d080b5eb337c3793065377635'
    group by 1
    order by 1 desc
    Run a query to Download Data