fb3ce38c-7bfe-475c-bca8-3f1e44ae80a6Fancraze_secondary_marketplace
    Updated 2023-10-02
    WITH ranked_buyers AS (
    SELECT
    buyer,
    DATE_TRUNC('month', 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.4eded0de73020ca5.CricketMoments')
    ),

    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('month', f.block_timestamp) AS block_timestamp,
    Run a query to Download Data