adriaparcerisasflow stats: yearly nft sales
Updated 2024-01-06
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
prices as (
select
trunc(timestamp,'hour') as hour,
token_contract,
avg(price_usd) as price_usd
from flow.price.fact_prices
where timestamp<'2024-01-01'
group by 1,2
),
final as (
SELECT
trunc(block_timestamp,'year') as year,
count(distinct tx_id) as sales,
sum(sales) over (order by year) as total_sales,
count(distinct buyer) as nft_buyers,
sum(price*price_usd) as volume,
sum(volume) over (order by year) as total_volume,
count(distinct nft_collection) as active_collections
from flow.nft.ez_nft_sales x
join prices y on trunc(x.block_timestamp,'hour')=hour
and x.currency=y.token_contract
where tx_succeeded='true'
and x.block_timestamp<'2024-01-01'
group by 1
order by 1 asc
),
final2 as (
SELECT
trunc(block_timestamp,'year') as year,
count(distinct tx_id) as sales,
sum(sales) over (order by year) as total_sales,
QueryRunArchived: QueryRun has been archived