elsinaPost Merge: Swaps
Updated 2022-09-25
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with block_with_block_age as (
select
ORIGIN_FROM_ADDRESS,
AMOUNT_OUT_USD,
date_trunc('day', block_timestamp) as "Day Hour",
case when block_number < 15537394 then 'before merge' else 'after merge' end as "Merge Time",
BLOCK_TIMESTAMP as "current",
lag(BLOCK_TIMESTAMP,1) over (order by BLOCK_NUMBER) as "prev",
round(datediff(MILLISECONDS,"prev","current")/1000,1) as "Block Age"
from ethereum.core.ez_dex_swaps
where BLOCK_TIMESTAMP > '2022-09-01' and AMOUNT_OUT_USD between AMOUNT_IN_USD*75/100 and AMOUNT_IN_USD*125/100
) select
"Day Hour", "Merge Time",
sum(1) as "Swap Count",count(distinct ORIGIN_FROM_ADDRESS) "Swapper",
sum(AMOUNT_OUT_USD) as "Volume(USD)"
from block_with_block_age
group by "Day Hour","Merge Time" order by "Day Hour"
Run a query to Download Data