headitmanagerAlgo balances of wallets
    Updated 2022-07-06
    with unique_swapper_overtime as (select count(distinct swapper),block_timestamp::date from algorand.swaps
    where block_timestamp::date >= '2022-05-01' and block_timestamp::date <'2022-07-01'
    group by block_timestamp::date)
    , swappers as(select distinct swapper from algorand.swaps where block_timestamp::date >= '2022-05-01' and block_timestamp::date <'2022-07-01' )
    ,asset_hold as (select count(*),sum(amount),asset_name from algorand.account_asset inner join swappers
    on swappers.swapper=address
    group by asset_name
    having sum(amount) > 1 and count(*)>10
    order by sum(amount) desc )
    ,algo_balance as (select sum(balance) as sm,address,
    case
    when sm<10 then 'ALgo < 10'
    when sm>=10 and sm<100 then '10 =< ALgo < 100'
    when sm>=100 and sm<1000 then '100 =< ALgo < 1000'
    when sm>=1000 and sm<100000 then '1000 =< ALgo < 100000'
    when sm>=100000 then '100000 =< ALgo' end as histogram
    from algorand.account inner join swappers
    on swappers.swapper=address
    group by address
    having sum(balance) > 0)
    , wallet_created as (select count(*),min_date from (select min(block_timestamp::date) as min_date,sender from algorand.transactions inner join swappers
    on swappers.swapper=sender
    group by sender) group by min_date)
    , how_often_dayofweek as (select count(*),dayname(block_timestamp::date) from algorand.swaps where swapper in (select swapper from swappers)
    group by dayname(block_timestamp::date))
    , how_often_dayofmonth as (select count(*),day(block_timestamp::date) from algorand.swaps where swapper in (select swapper from swappers)
    group by day(block_timestamp::date))


    select * from algo_balance
    Run a query to Download Data