Abolfazl_771025total overal
Updated 2023-03-15Copy 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
›
⌄
with sol_price as (
select
date(block_timestamp) as date,
avg(swap_to_amount) / avg(swap_from_amount) as solprice
from solana.fact_swaps
where swap_from_mint = 'So11111111111111111111111111111111111111112'
and swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
and swap_to_amount > 0
and swap_from_amount > 0
group by 1
order by 1 asc
)
select
'Magic eden' as marketplace,
count(DISTINCT purchaser) as buyer_count,
count (a.tx_id) as sales_count,
sum(sales_amount * solprice) as volume
from solana.core.fact_nft_sales a join sol_price b on date(a.block_timestamp) = b.date
where MARKETPLACE in ('magic eden v1' , 'magic eden v2')
group by 1
union
select
marketplace,
count(DISTINCT purchaser) as buyer_count,
count (a.tx_id) as sales_count,
sum(sales_amount * solprice) as volume
from solana.core.fact_nft_sales a join sol_price b on date(a.block_timestamp) = b.date
where marketplace not in ('magic eden v1' , 'magic eden v2')
group by 1
Run a query to Download Data