pine_samisolana maketplaces volume
Updated 2022-11-24Copy 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
›
⌄
with solpricet as (
select block_timestamp::date as date,
avg (swap_to_amount/swap_from_amount) as solprice
from solana.fact_swaps
where swap_from_mint = 'So11111111111111111111111111111111111111112' --SOL
and swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') --USDC,USDT
and swap_to_amount > 0
and swap_from_amount > 0
and succeeded = 'TRUE'
group by 1)
select
date_trunc('{{date_range}}', block_timestamp) as date,
marketplace,
count (distinct tx_id) as Sales_Count,
count(distinct SELLER) as seller,
count(distinct PURCHASER ) as buyer,
count(distinct MINT ) as nfts,
sum (sales_amount*solprice) as Total_Sale_Volume
from solana.core.fact_nft_sales a join solpricet b on a.block_timestamp::date = b.date
where succeeded = 'TRUE'
group by 1,2
Run a query to Download Data