mlhnumber and volume of swaps in solana vs sol price
Updated 2022-06-30Copy 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
30
›
⌄
with num_vol_swap as (
select
block_timestamp::date as days,
count(distinct tx_id) as number_of_swaps,
sum(swap_from_amount) as swap_volume,
avg(swap_from_amount + swap_to_amount) as avg_swap_amount
from solana.core.fact_swaps
where block_timestamp::date >= '2021-01-01'
and swap_from_amount > 0
group by 1
order by 1
),
sol_price as (
SELECT
hour::date as days,
avg(price) as price
FROM ethereum.core.fact_hourly_token_prices
WHERE token_address = lower( '0xD31a59c85aE9D8edEFeC411D448f90841571b89c' )
group by 1
ORDER BY 1
)
select
num_vol_swap.days as days,
num_vol_swap.number_of_swaps as number_of_swaps,
num_vol_swap.swap_volume as swap_volume,
num_vol_swap.avg_swap_amount as avg_swap_amount,
sol_price.price as sol_price
from num_vol_swap
left join sol_price using(days)
Run a query to Download Data