Afonso_DiazOvertime
Updated 2024-10-12
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 t as (
select
tx_id,
block_timestamp,
seller_address,
buyer_address,
platform_name,
nft_address,
amount_usd,
project_name as collection_name
from
sei.nft.ez_nft_sales
where
block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
and amount_usd < 1e6
and tx_succeeded
)
select
date_trunc('{{ period }}', block_timestamp) as date,
platform_name,
count(distinct tx_id) as transactions,
count(distinct seller_address) as sellers,
count(distinct buyer_address) as buyers,
count(distinct collection_name) as collections,
sum(amount_usd) as volume_usd,
avg(amount_usd) as average_amount_usd,
sum(transactions) over (partition by platform_name order by date) as cumulative_transactions,
sum(volume_usd) over (partition by platform_name order by date) as cumulative_volume_usd
from t
where
date between '{{ start_date }}' and '{{ end_date }}'
group by 1, 2
order by 1, 2
QueryRunArchived: QueryRun has been archived