trexolBlocklords Heroes(Platform)
Updated 2024-09-21Copy 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
33
34
35
36
›
⌄
WITH project_sales AS (
SELECT *
FROM base.nft.ez_nft_sales
WHERE nft_address = '0x0982b3a5b24b2bd8ef74126e15fca2decfd75a28'
AND block_timestamp >= '2024-01-01'
),
platform_stats AS (
SELECT
platform_name,
COUNT(DISTINCT tx_hash) AS total_sales,
SUM(price_usd) AS total_volume_usd,
AVG(price_usd) AS avg_price_usd,
SUM(total_fees_usd) AS total_fees_usd,
SUM(platform_fee_usd) AS platform_fees_usd,
SUM(creator_fee_usd) AS creator_fees_usd
FROM project_sales
GROUP BY platform_name
),
ranked_platforms AS (
SELECT
*,
ROW_NUMBER() OVER (ORDER BY total_volume_usd DESC) AS volume_rank,
SUM(total_volume_usd) OVER () AS grand_total_volume
FROM platform_stats
)
SELECT
platform_name,
total_sales,
total_volume_usd,
avg_price_usd,
total_fees_usd,
platform_fees_usd,
creator_fees_usd,
volume_rank,
(total_volume_usd / grand_total_volume * 100) AS market_share_percentage
FROM ranked_platforms
QueryRunArchived: QueryRun has been archived