nasdfajskljweak-pink
Updated 2024-09-14
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
31
32
33
34
35
›
⌄
with data as (
select
DATEADD(
minute,
FLOOR(DATE_PART(minute, block_timestamp) / 15) * 15,
DATE_TRUNC('hour', block_timestamp)
) AS rounded_timestamp
,swap_to_mint as token
,swap_from_amount_usd as usd
from solana.defi.ez_dex_swaps
where 1=1
and swap_to_mint='FiVKJ5CJv6VZWAMdzt5vm6gU4WS3cQKKczWpQyeRFuCT'
UNION ALL
select
DATEADD(
minute,
FLOOR(DATE_PART(minute, block_timestamp) / 15) * 15,
DATE_TRUNC('hour', block_timestamp)
) AS rounded_timestamp
,swap_from_mint
,swap_to_amount_usd as usd
from solana.defi.ez_dex_swaps
where 1=1
and swap_from_mint='FiVKJ5CJv6VZWAMdzt5vm6gU4WS3cQKKczWpQyeRFuCT'
)
select
rounded_timestamp as rounded_time
,token
,sum(usd) as usd
from data
group by rounded_timestamp, token
order by rounded_timestamp
QueryRunArchived: QueryRun has been archived