DiamondNFLAD Packs and Moment Sales (!)
    Updated 2024-01-19
    -- forked from 0090ac79-eaa1-4e5c-bd28-9418ed3df040

    WITH
    sales AS (
    SELECT
    block_timestamp,
    block_height,
    n.nft_id,
    n.nft_collection,
    case
    when nft_collection = 'A.e4cf4bdc1751c65d.AllDay' then '🏈 NFL All Day Moments'
    when nft_collection = 'A.e4cf4bdc1751c65d.PackNFT' then '🏈 NFL All Day Packs'
    end as collection,
    n.price,
    n.seller,
    n.buyer,
    marketplace,
    n.tx_id,
    currency
    FROM
    flow.nft.ez_nft_sales n
    WHERE
    nft_collection in (
    'A.e4cf4bdc1751c65d.AllDay',
    'A.e4cf4bdc1751c65d.PackNFT'
    )
    ),
    prices as (
    select
    trunc(recorded_hour, 'hour') as dates,
    avg(close) as price_usd
    from
    flow.price.fact_hourly_prices
    where
    token = 'Flow'
    group by
    QueryRunArchived: QueryRun has been archived