zakkisyedPrice Distribution
Updated 2023-04-06
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
›
⌄
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