boomer77Wealth Distribution
    Updated 2021-11-24
    with raw as (select date, address, sum(balance) as LUNA_amount, case
    when LUNA_amount < 100 then '<100'
    when LUNA_amount between 100 and 1000 then '100-1000'
    when LUNA_amount between 1000 and 10000 then '1000-10,000'
    else '>10,000' end as LUNAtics
    from terra.daily_balances
    where currency = 'LUNA' and date >= CURRENT_DATE - 30
    group by 1,2)

    select date, LUNAtics, count(distinct address) as Counts
    from raw
    group by 1,2
    Run a query to Download Data