khanhUntitled Query
Updated 2022-11-22
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
block_timestamp::date as day,
avg(swap_to_amount/swap_from_amount) as sol_price_usd
from solana.fact_swaps
where
swap_from_mint = 'So11111111111111111111111111111111111111112'
and swap_to_mint in (
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
)
and succeeded = true
and swap_to_amount > 0
and swap_from_amount > 0
group by day
)
select
marketplace,
iff(day >= '2022-11-08', 'After FTX News', 'Before FTX News') as timespan,
count(distinct(tx_id)) as sales_count,
sum(sales_amount) as sales_total_amount,
sum(sales_amount * sol_price_usd) as sales_total_amount_usd,
count(distinct(purchaser)) as purchasers_count,
(sales_count / purchasers_count) as tx_per_purchaser,
(sales_total_amount / purchasers_count) as sales_amount_per_purchaser,
(sales_total_amount_usd / purchasers_count) as sales_amount_per_purchaser,
avg(sales_amount) as price_avg,
median(sales_amount) as price_median,
avg(sales_amount * sol_price_usd) as price_usd_avg,
median(sales_amount * sol_price_usd) as price_usd_median
from solana.core.fact_nft_sales a
join prices
on day = a.block_timestamp::date
Run a query to Download Data