ajetifiscal-fuchsia copy
    Updated 2024-10-09
    WITH monthly_sales AS (
    SELECT
    DATE_TRUNC('month', block_timestamp) AS month,
    COUNT(tx_hash) AS sales_transactions,
    COUNT(DISTINCT seller_address) AS unique_sellers,
    COUNT(DISTINCT buyer_address) AS unique_buyers,
    SUM(total_price) AS sales_volume_apt,
    SUM(total_price_usd) AS sales_volume_usd
    FROM
    aptos.nft.ez_nft_sales
    WHERE
    project_name ILIKE '%Aptomingos%'
    GROUP BY
    1
    ),
    new_buyers AS (
    SELECT
    DATE_TRUNC('month', MIN(block_timestamp)) AS first_purchase_month,
    buyer_address
    FROM
    aptos.nft.ez_nft_sales
    WHERE
    project_name ILIKE '%Aptomingos%'
    GROUP BY
    buyer_address
    )
    SELECT
    ms.month,
    ms.sales_transactions,
    ms.unique_sellers,
    ms.unique_buyers,
    COUNT(nb.buyer_address) AS new_buyers,
    ms.sales_volume_apt,
    ms.sales_volume_usd
    FROM
    monthly_sales ms
    QueryRunArchived: QueryRun has been archived