mlhsol swap
Updated 2022-11-15Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
select date_trunc('day', block_timestamp) as day,
case when swap_from_mint = 'So11111111111111111111111111111111111111112' then 'Swap From SOL'
when swap_to_mint = 'So11111111111111111111111111111111111111112' then 'Swap To SOL' end as swap_type,
count (distinct tx_id) as Swaps_Count,
count (distinct swapper) as Swappers_Count,
sum (case when swap_from_mint = 'So11111111111111111111111111111111111111112' then swap_from_amount
when swap_to_mint = 'So11111111111111111111111111111111111111112' then swap_to_amount end) as Total_Volume,
avg (case when swap_from_mint = 'So11111111111111111111111111111111111111112' then swap_from_amount
when swap_to_mint = 'So11111111111111111111111111111111111111112' then swap_to_amount end) as Average_Volume
from solana.core.fact_swaps
where succeeded = 'TRUE'
and (swap_from_mint = 'So11111111111111111111111111111111111111112' or swap_to_mint = 'So11111111111111111111111111111111111111112')
and block_timestamp >= CURRENT_DATE - 7
group by 1,2
order by 1
Run a query to Download Data