0-MIDnew swappers
Updated 2025-02-07
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
›
⌄
with tab1 as (
select date_trunc('minute',BLOCK_TIMESTAMP) as time
,SYMBOL
,ORIGIN_FROM_ADDRESS
,AMOUNT_USD
,TX_HASH
from ronin.core.ez_token_transfers
where ORIGIN_TO_ADDRESS='0x7d0556d55ca1a92708681e2e231733ebd922597d'
and ORIGIN_FROM_ADDRESS=FROM_ADDRESS
and BLOCK_TIMESTAMP::date>=current_date-30
),
tab2 as (
select date_trunc('day',time) as day
,ORIGIN_FROM_ADDRESS
,AMOUNT_USD
,row_number()over(partition by ORIGIN_FROM_ADDRESS order by day) as time_row
from tab1
)
select day
,sum(AMOUNT_USD) as volume
,sum(volume)over(order by day) as total_volume
from tab2
where time_row=1
group by 1
QueryRunArchived: QueryRun has been archived