MLDZMNXAR2
Updated 2023-01-26
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
›
⌄
with tb2 AS (
select
RECORDED_HOUR::date as day,
avg(close) as price_token
from solana.core.fact_token_prices_hourly where SYMBOL='SOL'
group by 1)
select
date_trunc('week',BLOCK_TIMESTAMP) as date,
count(distinct tx_id) as sale_no,
count(distinct PURCHASER) as buyer_no,
sum(SALES_AMOUNT) as volume,
sum(SALES_AMOUNT*price_token) as volume_usd,
avg(SALES_AMOUNT*price_token)as average_volume,
Median(SALES_AMOUNT*price_token) as median_volume,
avg(average_volume) OVER (ORDER BY date ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as MA_7_Days,
avg(average_volume) OVER (ORDER BY date ROWS BETWEEN 14 PRECEDING AND CURRENT ROW) as MA_14_Days,
min(SALES_AMOUNT*price_token) as floor_price,
max(SALES_AMOUNT*price_token) as highest_price,
sum(buyer_no) over (order by date) as cum_buyers,
sum(sale_no) over (order by date) as cum_sale,
sum(volume_usd) over (order by date) as cum_volume
from solana.core.fact_nft_sales x join tb2 y on x.BLOCK_TIMESTAMP::date=y.day
left join solana.core.dim_nft_metadata z on x.mint=z.mint
where SUCCEEDED='TRUE' and MARKETPLACE ='exchange art'
and SALES_AMOUNT > 0
group by 1
Run a query to Download Data