freemartianUFC Sales - Regular VS Common With TopShots
    Updated 2022-06-12
    with
    top_shot_buyer as (
    select distinct buyer as topshot_buyer
    from flow.core.fact_nft_sales
    where nft_collection = 'A.0b2a3299cc857e29.TopShot'
    ),

    ufc_sales as (
    select buyer, date_trunc('day', block_timestamp::date) as TIME
    from flow.core.fact_nft_sales
    where nft_collection = 'A.329feb3ab062d289.UFC_NFT'
    and block_timestamp > '2022-05-09'
    group by TIME, buyer
    )

    select count(u.buyer) as buyer, 'common' as label, u.TIME
    from ufc_sales u
    inner join top_shot_buyer t on t.topshot_buyer = u.buyer
    group by u.TIME, label
    UNION
    select count(u.buyer) as buyer,'regular' as label, u.TIME
    from ufc_sales u
    group by u.TIME, label
    Run a query to Download Data