ArioWhat makes a Top Shots moment valuable? (Part I) - maximum holding of every type
    Updated 2022-07-26
    with
    sales_data as (
    select
    BLOCK_TIMESTAMP,
    NFT_ID,
    BUYER,
    SELLER,
    TX_SUCCEEDED
    from flow.core.fact_nft_sales
    where
    NFT_COLLECTION = 'A.0b2a3299cc857e29.TopShot'
    and TX_SUCCEEDED = True
    ),
    TopShot_Metadata as (
    select
    NFT_ID,
    PLAY_TYPE
    from flow.core.dim_topshot_metadata
    ),
    general_table as (
    select
    BLOCK_TIMESTAMP::date as date,
    m.NFT_ID as id,
    BUYER,
    SELLER,
    PLAY_TYPE
    --date_trunc('day', BLOCK_TIMESTAMP) as date,
    from sales_data s
    inner join TopShot_Metadata m on s.NFT_ID = m.NFT_ID
    ),
    final_table as (
    select
    t1.date as selling_time,
    t2.date as buying_time,
    t1.id as NFT,
    t1.PLAY_TYPE
    Run a query to Download Data