afonsoUntitled Query
Updated 2023-01-21Copy 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with arbitrum as (
select
date_trunc('week', block_timestamp)::date as day,
count(distinct tx_hash) as arbitrum_swaps_count,
count(distinct origin_from_address) as arbitrum_swappers_count
from arbitrum.core.fact_event_logs
where event_name = 'Swap'
group by day
),
ethereum as (
select
date_trunc('week', block_timestamp)::date as day,
count(distinct tx_hash) as ethereum_swaps_count,
count(distinct origin_from_address) as ethereum_swappers_count
from ethereum.core.fact_event_logs
where event_name = 'Swap'
group by day
),
optimism as (
select
date_trunc('week', block_timestamp)::date as day,
count(distinct tx_hash) as optimism_swaps_count,
count(distinct origin_from_address) as optimism_swappers_count
from optimism.core.fact_event_logs
where event_name = 'Swap'
group by day
)
select *,
sum(arbitrum_swaps_count) over (order by day asc) as cumulative_arbitrum_swaps_count,
sum(arbitrum_swappers_count) over (order by day asc) as cumulative_arbitrum_swappers_count,
sum(ethereum_swaps_count) over (order by day asc) as cumulative_ethereum_swaps_count,
sum(ethereum_swappers_count) over (order by day asc) as cumulative_ethereum_swappers_count,
sum(optimism_swaps_count) over (order by day asc) as cumulative_optimism_swaps_count,
Run a query to Download Data