shadilALGO balance distribution of swappers
    Updated 2022-07-05
    select distribution, count(distribution) as distribution_swappers
    from (select CASE WHEN total_algo = 1
    THEN 'Have Only 1 ALGO'
    WHEN total_algo >= 2 and total_algo <= 5
    THEN 'Have between 2 and 5 ALGOs'
    WHEN total_algo >= 6 and total_algo <= 50
    THEN 'Have between 5 and 50 ALGOs'
    WHEN total_algo >= 51 and total_algo <= 500
    THEN 'Have between 50 and 500 ALGOs'
    WHEN total_algo >= 501 and total_algo <= 5000
    THEN 'Have between 500 and 5,000 ALGOs'
    WHEN total_algo >= 5001 and total_algo <= 50000
    THEN 'Have between 5,000 and 50,000 ALGOs'
    WHEN total_algo >= 50001 and total_algo <= 500000
    THEN 'Have between 50,000 and 500,000 ALGOs'
    WHEN total_algo >= 500001 THEN 'Have more than 500,000 ALGOs'
    END as distribution
    from (select address, sum(balance) as total_algo
    from flipside_prod_db.algorand.account join (select swapper as wallet_address
    from flipside_prod_db.algorand.swaps das
    where date_trunc('day', das.block_timestamp) >= '2022-05-01'
    and date_trunc('day', das.block_timestamp) < '2022-07-01') as table1
    on table1.wallet_address = address
    where balance != 0
    group by address))
    group by distribution
    Run a query to Download Data