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_txns_count,
count(distinct from_address) as arbitrum_active_users_count,
sum(tx_fee) as arbitrum_tx_total_fee,
avg(tx_fee) as arbitrum_tx_avg_fee
from arbitrum.core.fact_transactions
group by day
),
ethereum as (
select
date_trunc('week', block_timestamp)::date as day,
count(distinct tx_hash) as ethereum_txns_count,
count(distinct from_address) as ethereum_active_users_count,
sum(tx_fee) as ethereum_tx_total_fee,
avg(tx_fee) as ethereum_tx_avg_fee
from ethereum.core.fact_transactions
group by day
),
optimism as (
select
date_trunc('week', block_timestamp)::date as day,
count(distinct tx_hash) as optimism_txns_count,
count(distinct from_address) as optimism_active_users_count,
sum(tx_fee) as optimism_tx_total_fee,
avg(tx_fee) as optimism_tx_avg_fee
from optimism.core.fact_transactions
group by day
)
select *,
sum(arbitrum_txns_count) over (order by day asc) as cumulative_arbitrum_txns_count,
sum(arbitrum_active_users_count) over (order by day asc) as cumulative_arbitrum_active_users_count,
Run a query to Download Data