NavidUntitled Query
    Updated 2022-10-23
    with mints as (
    select
    date(block_timestamp) as day,
    count(distinct tx_id) as number_of_transactions
    -- tx_id as tx_hash
    -- event_data:id as nft_id
    from
    flow.core.fact_events
    where
    event_contract like '%RaceDay_NFT%' and
    event_type like 'Minted'
    group by
    day
    ), sells as (
    select
    date(block_timestamp) as day,
    count(distinct tx_id) as number_of_transactions
    from
    flow.core.ez_nft_sales
    where
    NFT_COLLECTION like '%RaceDay%'
    group by
    day
    )
    select
    m.day,
    m.number_of_transactions as "Mint Sales",
    sum("Mint Sales") over (order by m.day asc) as "Total Mints Sales",
    avg("Mint Sales") over (order by m.day asc rows between 7 preceding and current row) as "Average Mint Sales",
    s.number_of_transactions as "Secondary Sales",
    sum("Secondary Sales") over (order by s.day asc) as "Total Secondary Sales",
    avg("Secondary Sales") over (order by s.day asc rows between 7 preceding and current row) as "Average Secondary Sales"
    from
    mints m join sells s on m.day=s.day
    order by
    m.day asc
    Run a query to Download Data