jimmysandhsol14
Updated 2022-12-19Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with solana_tb1 as (select block_timestamp::date as sol_price_date, avg(swap_to_amount/swap_from_amount) as sol_price
from solana.fact_swaps where swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
and swap_from_mint = 'So11111111111111111111111111111111111111112'
and swap_to_amount > 0 and succeeded = 'TRUE'
group by 1)
select
project_name,
seller,
count(distinct tx_id) as "Number of Sales",
sum(sales_amount*sol_price) as "Sales Volume [USD]"
from solana.core.fact_nft_sales a join solana.core.dim_nft_metadata b using(mint) join solana_tb1 c on a.block_timestamp::date = c.sol_price_date
where marketplace = 'coral cube'
and succeeded = 'TRUE'
and block_timestamp >= '2022-09-22'
group by 1, 2
order by 3 desc
limit 10
Run a query to Download Data