CryptoIcicleAlgo-81.The Octorand Universe - Gen Breakdown
    Updated 2022-05-27
    -- Payout 174.87 ALGO
    -- Grand Prize 524.61 ALGO
    -- Level Intermediate


    -- Q81. Octorand is a virtual world of opportunity built on top of the Algorand blockchain.
    -- Octo Primes are the only form of life existing in the world of Octorand.
    -- You can collect these Octo Primes, transform them to increase their value and trade them through the inbuilt marketplace.

    -- Show the number of Octo Primes Gen1 and Octo Primes Gen2 each wallet holds.
    -- How many unique holders are there for Gen1 and Gen2?
    -- How many Gen2 holders hold an Oct Prime Gen1?
    -- Show Octo Primes Gen1 and Octo Primes Gen2 sales and ALGO volume over time.

    -- Note any other insights you find about the Octo Prime sales or holders!
    -- Tips: https://www.nftexplorer.app/stats https://octorand.com/track/statistics https://octorand.com/track/sales https://octorand.com/

    with nfts as (
    select
    iff(contains(lower(asset_name),'gen2'), 'gen2', 'gen1') as gen,
    *
    from flipside_prod_db.algorand.asset
    where asset_name ilike 'Octo Prime%'
    and total_supply = 1
    and asset_deleted = 'FALSE'
    order by asset_name asc
    ),
    wallets as (
    select
    address as wallet,
    gen,
    count(distinct a.asset_id) as n_nfts
    from flipside_prod_db.algorand.account_asset a
    join nfts n on a.asset_id = n.asset_id and a.asset_last_removed is null and a.amount > 0
    group by wallet, gen
    order by n_nfts desc
    Run a query to Download Data