0x311C0b4eD4A0E0f12b92513a3Dd716a92A79bC09daily sale for the past 30 days
    Updated 2024-08-22
    WITH daily_sales AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS sale_date,
    sales_amount,
    purchaser,
    seller,
    mint,
    succeeded
    FROM solana.nft.fact_nft_sales
    WHERE program_id = 'TCMPhJdwDryooaGtiocG1u3xcYbRpiJzb283XfCZsDp'
    AND block_timestamp >= DATEADD(day, -30, CURRENT_TIMESTAMP)
    AND succeeded = TRUE
    )

    SELECT
    sale_date,
    ARRAY_AGG(sales_amount) AS daily_sales_amounts,
    ARRAY_AGG(purchaser) AS daily_purchasers,
    ARRAY_AGG(seller) AS daily_sellers,
    ARRAY_AGG(mint) AS daily_mints
    FROM daily_sales
    GROUP BY sale_date
    ORDER BY sale_date DESC;


    QueryRunArchived: QueryRun has been archived