Spiltadavidarb vs op daily stats
Updated 2023-01-21
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 arb as (
select
date_trunc('day',BLOCK_TIMESTAMP) as adate,
count(distinct TX_HASH) as arb_tx,
count(distinct FROM_ADDRESS) as arb_user,
sum(tx_fee) as total_arb_fee,
sum(ETH_VALUE) as arb_eth_value,
total_arb_fee/arb_tx as arb_fee_per_tx,
arb_eth_value/arb_tx as eth_value_per_tx,
arb_eth_value/arb_user as eth_value_per_user,
sum(arb_user) over (order by adate asc) as cum_arb_user,
sum(arb_eth_value) over (order by adate asc) as cum_arb_eth_value
from arbitrum.core.fact_transactions
where adate >= current_date - 90
and STATUS = 'SUCCESS'
group by 1
) ,
op as (
select
date_trunc('day',BLOCK_TIMESTAMP) as odate,
count(distinct TX_HASH) as op_tx,
count(distinct FROM_ADDRESS) as op_user,
sum(tx_fee) as total_op_fee,
sum(ETH_VALUE) as op_eth_value,
total_op_fee/op_tx as op_fee_per_tx,
op_eth_value/op_tx as eth_value_per_tx,
op_eth_value/op_user as eth_value_per_user,
sum(op_user) over (order by odate asc) as cum_op_user,
sum(op_eth_value) over (order by odate asc) as cum_op_eth_value
from optimism.core.fact_transactions
where odate >= current_date - 90
and STATUS = 'SUCCESS'
group by 1
)