afonsoUntitled Query
Updated 2023-01-19Copy 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
›
⌄
with t as (
select
count(distinct tx_hash) as swaps_count_may_2022,
count(distinct origin_from_address) as swappers_count_may_2022
from ethereum.core.fact_event_logs
where event_name ilike '%swap%'
and block_timestamp between '2022-06-01' and '2022-06-30'
),
t2 as (
select
count(distinct tx_hash) as swaps_count_january_2023,
count(distinct origin_from_address) as swappers_count_january_2023
from ethereum.core.fact_event_logs
where event_name ilike '%swap%'
and block_timestamp between'2022-12-19' and '2023-01-19'
)
select *,
((swaps_count_january_2023 - swaps_count_may_2022) / swaps_count_may_2022) * 100 as swaps_percent_change,
((swappers_count_january_2023 - swappers_count_may_2022) / swappers_count_may_2022) * 100 as swappers_percent_change
from t join t2
Run a query to Download Data