kasadeghThe distribution of ALGO balances of wallets that own a wildlife warrior
    Updated 2022-06-23
    with algo_balance AS
    (
    select acc.ADDRESS,sum(BALANCE) as BALANCE
    from algorand.asset as ass
    join flipside_prod_db.algorand.account_asset as acc_ass on ass.asset_id = acc_ass.asset_id
    join flipside_prod_db.algorand.account as acc on acc.address = acc_ass.address
    join flipside_prod_db.algorand.block as bl on acc.created_at = bl.block_id
    where ass.asset_name like 'Warrior Croc%' and
    (ass.creator_address = 'A62XRVE7ZWSXLAA4YDDI7GUMCHML2TT3JXFT3OWTVQAKOZSBGNT7FX5YQU' or ass.creator_address = 'SRRIUGPVPPGST3KPH32XQXTE567G6LHCEX2IMHDRW2IWH3427UVWXRXHCQ')
    group by acc.ADDRESS
    order by 2 desc
    )
    select "Total ALGO BALANCE bin",count(*) as "Total number of wallets" from
    (
    select BALANCE,CASE
    WHEN BALANCE<100 THEN '<100'
    WHEN BALANCE>100 and BALANCE<1000 THEN '>100 and <1000'
    WHEN BALANCE>1000 and BALANCE<10000 THEN '>1000 and <10000'
    WHEN BALANCE>10000 and BALANCE<100000 THEN '>10000 and <100000'
    WHEN BALANCE>100000 and BALANCE<1000000 THEN '>100000 and <1000000'
    WHEN BALANCE>100000 and BALANCE<10000000 THEN '>1000000 and <10000000'
    ELSE '>10000000' END as "Total ALGO BALANCE bin"
    from algo_balance
    ) as tt
    group by "Total ALGO BALANCE bin"
    order by "Total ALGO BALANCE bin"
    Run a query to Download Data