LTirrell2023-06-12 04:12 PM
Updated 2023-06-19
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
›
⌄
with
hourly_volume as (
select
date_trunc('hour', block_timestamp) as datetime,
sum(swap_from_amount * p.close) as volume_usd
from
solana.core.fact_swaps
join solana.core.ez_token_prices_hourly p on date_trunc('hour', block_timestamp) = p.recorded_hour
and swap_from_mint = p.token_address
where
succeeded
and swap_program like 'jupiter%'
and block_timestamp > current_date - interval '7 day'
group by
datetime
)
select
date_trunc('day', datetime) as date,
sum(volume_usd) as volume_usd
from
hourly_volume
group by
date
order by
date desc
Run a query to Download Data