zakkisyedPrice Distribution
    Updated 2023-04-06
    WITH price_distribution AS (
    SELECT
    DATE_TRUNC('week', BLOCK_TIMESTAMP) AS dt,
    CASE
    WHEN PRICE_USD < 10 THEN '< $10'
    WHEN PRICE_USD < 100 THEN '< $100'
    WHEN PRICE_USD < 1000 THEN '< $1000'
    ELSE '>= $1000'
    END AS price_bucket,
    COUNT(*) AS num_sales
    FROM
    ethereum.core.ez_nft_sales
    WHERE
    BLOCK_TIMESTAMP >= '2022-01-01'
    GROUP BY
    1,2
    )

    SELECT
    price_distribution.dt AS date,
    price_distribution.price_bucket,
    SUM(price_distribution.num_sales) AS num_sales
    FROM
    price_distribution
    GROUP BY
    1,2
    ORDER BY
    date ASC,
    price_bucket ASC

    Run a query to Download Data