jackguy30 Day NFT Sales Activty by Chain
Updated 2023-11-07
999
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
31
32
33
34
35
36
›
⌄
WITH
ThirtyDayData AS (
-- Calculate metrics for the last 30 days for all blockchains
SELECT
blockchain,
COUNT(*) as sales_30d,
COUNT(DISTINCT BUYER_ADDRESS) as buyers_30d,
SUM(PRICE_USD) as sales_volume_usd_30d
FROM (
SELECT 'Ethereum' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM ethereum.core.ez_nft_sales
UNION ALL
SELECT 'Polygon' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM polygon.core.ez_nft_sales
UNION ALL
SELECT 'Avalanche' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM avalanche.core.ez_nft_sales
UNION ALL
SELECT 'Arbitrum' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM arbitrum.core.ez_nft_sales
UNION ALL
SELECT 'Optimism' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM optimism.core.ez_nft_sales
) AS combined
WHERE BLOCK_TIMESTAMP > current_date - 30
GROUP BY blockchain
),
SixtyDayData AS (
-- Calculate metrics for the 30 days before the last 30 days for all blockchains
SELECT
blockchain,
COUNT(*) as sales_60d,
COUNT(DISTINCT BUYER_ADDRESS) as buyers_60d,
SUM(PRICE_USD) as sales_volume_usd_60d
FROM (
SELECT 'Ethereum' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM ethereum.core.ez_nft_sales
UNION ALL
SELECT 'Polygon' as blockchain, BLOCK_TIMESTAMP, BUYER_ADDRESS, PRICE_USD FROM polygon.core.ez_nft_sales
UNION ALL
Run a query to Download Data