Sbhn_NPStats comparison flow collections
    Updated 2022-10-20
    with flowpricee as (
    select TIMESTAMP::date as date, avg(price_usd) as flowprice
    from flow.core.fact_prices
    where symbol ='FLOW' and source ='coinmarketcap'
    group by 1)

    select 'TopShot' as collection,
    count (distinct tx_id) as Sales_Count,
    count (distinct nft_id) as Tokens_Count,
    count (distinct buyer) as Buyers_Count,
    count (distinct seller) as Sellers_Count,
    count (distinct marketplace) as Markets_Count,
    sum (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Total_Sale_Volume,
    avg (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Average_Sale_Volume,
    median (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Median_Sale_Volume,
    min (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Min_Sale_Volume,
    max (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Maximum_Sale_Volume
    from flow.core.ez_nft_sales t1 join flowpricee t2 on t1.block_timestamp::date = t2.date
    where nft_collection = 'A.0b2a3299cc857e29.TopShot'
    and tx_succeeded = 'TRUE'
    group by 1
    UNION

    select 'AllDay' as collection,
    count (distinct tx_id) as Sales_Count,
    count (distinct nft_id) as Tokens_Count,
    count (distinct buyer) as Buyers_Count,
    count (distinct seller) as Sellers_Count,
    count (distinct marketplace) as Markets_Count,
    sum (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Total_Sale_Volume,
    avg (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Average_Sale_Volume,
    median (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Median_Sale_Volume,
    min (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Min_Sale_Volume,
    max (case when currency ='A.ead892083b3e2c6c.FlowUtilityToken' then price*flowprice else price end) as Maximum_Sale_Volume
    from flow.core.ez_nft_sales t1 join flowpricee t2 on t1.block_timestamp::date = t2.date
    where nft_collection = 'A.e4cf4bdc1751c65d.AllDay'
    Run a query to Download Data