LittlerDataUntitled Query
Updated 2022-10-27Copy 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 Sales as (
select
nft_collection
,split(nft_collection, '.') as collection
,collection[2] as NFT
,sum(price) as Total_Sales
,count(distinct tx_id) as Number_Trades
from flow.core.ez_nft_sales
where nft_collection ilike ''
group by 1, 2, 3
),
perc as (
select
date_trunc('day',block_timestamp) as date
,nft_collection
,percentile_cont(.1) within group (order by price asc) as Floor
,percentile_cont(1) within group (order by price asc) as Ceiling
,median(price) as Median_Price
,avg(price) as Average_Price
from flow.core.ez_nft_sales
where nft_collection ilike '' and block_timestamp > current_date
group by 1, 2
order by 1 asc
)
select
sales.nft as "NFT Collection"
,sales.total_sales as "Total Sales"
,sales.Number_Trades as "Amount of Trades"
,perc.Floor
,perc.Ceiling
,perc.Median_Price as "Median Price"
,perc.Average_price as "Average Price"
from sales
join perc on perc.nft_collection = sales.NFT_collection
Run a query to Download Data