aureasarsanedesaptos in 2024 4
Updated 44 minutes ago
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
›
⌄
WITH nft_data AS (
SELECT
DATE_TRUNC('month', block_timestamp) AS month,
platform_name,
COUNT(DISTINCT tx_hash) AS total_sales,
SUM(total_price_usd) AS total_volume_usd
FROM aptos.nft.ez_nft_sales
WHERE DATE_TRUNC('day', block_timestamp) BETWEEN '2024-01-01' AND '2024-12-31'
GROUP BY 1, 2
),
ranked_nft_data AS (
SELECT
month,
platform_name,
total_sales,
total_volume_usd,
RANK() OVER (PARTITION BY month ORDER BY total_volume_usd DESC) AS rank_by_volume
FROM nft_data
)
SELECT
month,
platform_name,
total_sales,
total_volume_usd
FROM ranked_nft_data
WHERE rank_by_volume <= 5
ORDER BY month DESC, total_volume_usd DESC