saeedmznSolana Protocol Feature -- swap from/to SOL USDC
Updated 2022-07-13
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
›
⌄
with sol_from as (
select
date_trunc(week,BLOCK_TIMESTAMP) as date ,
count (DISTINCT tx_id) as num_swaps ,
sum(SWAP_FROM_AMOUNT) as volume ,
sum (volume) over (order by date) as cum_volume
from solana.core.fact_swaps join solana.core.dim_labels
on ADDRESS = SWAP_FROM_MINT
where SWAP_PROGRAM = 'raydium v4'
and SUCCEEDED = true
and SWAP_FROM_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'--usdc
group by 1
),
sol_to as (
select
date_trunc(week,BLOCK_TIMESTAMP) as date ,
count (DISTINCT tx_id) as num_swaps ,
sum(SWAP_TO_AMOUNT) as volume ,
sum (volume) over (order by date) as cum_volume
from solana.core.fact_swaps join solana.core.dim_labels
on ADDRESS = SWAP_TO_MINT
where SWAP_PROGRAM = 'raydium v4'
and SUCCEEDED = true
and SWAP_TO_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --usdc
group by 1
)
select 'swap_from' as type , date , num_swaps , volume,cum_volume from sol_from
UNION
select 'swap_to' as type , date , num_swaps , volume,cum_volume from sol_to
Run a query to Download Data