elvisNFTX Q1.1 22/6/12 TOTAL VOLUME ON NFTX
Updated 2022-06-12Copy Reference Fork
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
31
32
›
⌄
⌄
/*
Q1. Which 3 NFT collections have the most total sales volume in the last 60 days on NFTX? These are transactions where someone redeems their NFTX tokens for a specific NFT.
Hint: You can find these sales in ez_nft_sales. Visualize your findings.
*/
WITH NFTX_Proj_Vol AS (
SELECT project_name, sum(price) as volume_nftx_token, sum(price_usd) AS volume_usd, sum(platform_fee_usd) AS platform_fees_usd, sum(creator_fee_usd) as creator_fees_usd,
sum(total_fees_usd) AS total_fees_usd, sum(tx_fee_usd) AS Tx_fees_usd
FROM ethereum.core.ez_nft_sales
WHERE platform_name = 'nftx'
AND BLOCK_TIMESTAMP > CURRENT_DATE-60
AND event_type = 'redeem'
GROUP BY 1
ORDER BY 3 DESC
),
TOP9_proj AS (
SELECT project_name, volume_usd, rank() OVER (ORDER BY volume_usd DESC) AS vol_rank
FROM NFTX_Proj_Vol
ORDER BY volume_usd DESC
LIMIT 9
),
TOP10_proj AS (
(SELECT * FROM TOP9_proj) UNION (
SELECT 'Other' AS project_name, sum(volume_usd) AS volume_usd, 10 AS vol_rank
FROM NFTX_Proj_Vol
WHERE project_name NOT IN (SELECT project_name FROM TOP9_proj)
)
)
SELECT *
from TOP10_proj
ORDER BY vol_rank
Run a query to Download Data