yasminMarketplace Sales Distribution copy
Updated 2024-09-11
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 traders AS (
SELECT
date_trunc('week', block_timestamp) AS date,
COUNT(DISTINCT CASE WHEN seller_address IS NOT NULL THEN seller_address
WHEN buyer_address IS NOT NULL THEN buyer_address
END) AS n_traders
FROM
aptos.nft.ez_nft_sales
WHERE
EVENT_TYPE = 'sale'
AND platform_name in (
'{{platform_name}}')
AND block_timestamp::date >= '{{Start_Date}}' AND block_timestamp::date <= '{{End_Date}}'
GROUP BY
1
)
SELECT
traders.date,
traders.n_traders,
sales.transactions,
sales.volume_APT
FROM
traders
JOIN
(
SELECT
date_trunc('week', block_timestamp) AS date,
COUNT(DISTINCT TX_HASH) AS transactions,
SUM(TOTAL_PRICE) AS volume_APT
FROM
aptos.nft.ez_nft_sales
WHERE
EVENT_TYPE = 'sale'
AND platform_name in (