fb3ce38c-7bfe-475c-bca8-3f1e44ae80a6Dapper_combined_products_month
    Updated 2024-09-03
    WITH ranked_buyers AS (
    SELECT
    buyer,
    DATE_TRUNC('{{param__Ix2}}', block_timestamp) AS first_purchase_date,
    NFT_COLLECTION,
    ROW_NUMBER() OVER (
    PARTITION BY
    buyer
    ORDER BY
    block_timestamp
    ) AS rn
    FROM
    flow.nft.ez_nft_sales
    WHERE
    NFT_COLLECTION IN ('A.e4cf4bdc1751c65d.AllDay', 'A.329feb3ab062d289.UFC_NFT', 'A.0b2a3299cc857e29.TopShot')
    ),

    first_time_buyers AS (
    SELECT
    buyer,
    first_purchase_date,
    NFT_COLLECTION
    FROM
    ranked_buyers
    WHERE
    rn = 1
    )

    SELECT
    COUNT(*) AS Txn_Volume,
    SUM(price) AS Net_Sales,
    COUNT(DISTINCT f.seller) AS unique_daily_seller,
    COUNT(DISTINCT f.buyer) AS unique_daily_buyer,
    COUNT(DISTINCT ftb.buyer) AS first_time_buyers_count,

    DATE_TRUNC('{{param_Fc5w}}', f.block_timestamp) AS block_timestamp,
    QueryRunArchived: QueryRun has been archived