Sbhn_NPAverage Number of Sales, Active Buyers and Sellers in a Day
Updated 2022-11-02Copy 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
›
⌄
--credit : alik110
with maintable as (
select case when nft_address = '0x60bb1e2aa1c9acafb4d34f71585d7e959f387769' then 'Art Gobblers' else project_name end as Project_name,
block_timestamp::date as date,
count (distinct tx_hash) as Sales_Count,
count (distinct buyer_address) as Buyers_Count,
count (distinct seller_address) as Sellers_Count,
count (distinct nft_address) as Collections_Count,
count (distinct tokenid) as Tokens_Count,
sum (price_usd) as Total_USD_Volume,
avg (price_usd) as Average_USD_Volume,
median (price_usd) as Median_USD_Volume,
min (price_usd) as Min_USD_Volume,
max (price_usd) as Max_USD_Volume,
avg (Average_USD_Volume) over (order by date rows between 7 PRECEDING and current row) as Moving_Average_7,
avg (Average_USD_Volume) over (order by date rows between 30 PRECEDING and current row) as Moving_Average_30,
sum (total_usd_volume) over (order by date) as Cumulative_Volume,
sum (sales_count) over (order by date) as Cumulative_Sales_Count
from ethereum.core.ez_nft_sales
where nft_address in ('0x60bb1e2aa1c9acafb4d34f71585d7e959f387769','0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb','0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d')
and price_usd > 0
group by 1,2)
select project_name,avg (sales_count), avg (buyers_count), avg (sellers_count), avg (total_usd_volume)
from maintable
group by 1
Run a query to Download Data