Moefl dm 0
Updated 2023-03-31
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 flow_prices as (
select date_trunc('day', timestamp)::Date as day,
avg(price_usd) as flow_price
from flow.core.fact_prices
group by 1),
final as (select
s.*,flow_price
from flow.core.ez_nft_sales s,flow_prices p
where tx_succeeded = 'TRUE'
and s.BLOCK_TIMESTAMP::date = p.day
and NFT_COLLECTION ilike '%DimensionX'
)
select
date_trunc('{{Granularity}}',BLOCK_TIMESTAMP)::date as date,
CONTRACT_NAME as COLLECTION ,
flow_price,
avg(price) as avg_sale_vol,
min(price) as floor_price,
median(price) as median_sale_vol,
max(price) as max_price,
sum(price) as sale_volume_usd,
sum(sale_volume_usd)over( order by date rows between unbounded preceding and current row) as cum_sale_volume_usd,
count(distinct BUYER) as unique_BUYER,
sum(unique_BUYER)over( order by date rows between unbounded preceding and current row) as cum_unique_BUYER,
count(distinct SELLER) as unique_SELLER
,sum(unique_SELLER)over( order by date rows between unbounded preceding and current row) as cum_unique_SELLER,
count(distinct TX_ID) as sales,
sum(sales)over( order by date rows between unbounded preceding and current row) as cum_sales,
count(distinct NFT_ID) as unique_nft_sales
Run a query to Download Data