maybeyonasalgo_goose_nft_dist
    Updated 2022-06-08
    with
    nfts as (
    select
    asset_id,
    asset_name
    from algorand.asset
    where creator_address = 'GOOSECHXVEKJ4SO43NTW5HXOIGLFGC2SQDAVWQGJCN576ODJ5SECV6MUOM'
    -- and split(asset_name,' ')[0]::string = 'Al'
    -- and split(asset_name,' ')[1]::string = 'Goanna'
    ),
    user_nfts as (
    select
    address,
    sum(amount) as nfts
    from algorand.account_asset
    where asset_id in (select asset_id from nfts)
    and amount > 0
    group by 1
    ),
    user_bals as (
    select
    u.address,
    u.nfts,
    sum(balance) as algo_bals
    from user_nfts u join algorand.account a on u.address=a.address
    group by 1,2
    )

    select
    nfts,
    count(address) as users
    from user_bals
    group by 1

    Run a query to Download Data