nsa2000OPTOP1
Updated 2023-02-23
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 ethpricet as (
select hour::date as day,
avg (price) as ETHPrice
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
and day >= '2023-01-01'
group by 1)
select 'Optimism' as blockchain,
date_trunc(day,block_timestamp) as date,
count (distinct tx_hash) as TX_Count,
count (distinct from_address) as Users_Count,
sum (tx_fee) as Total_ETH_Fee,
avg (tx_fee) as Average_ETH_Fee,
max (tx_fee) as Maximum_ETH_Fee,
median (tx_fee) as Median_ETH_fee,
sum (tx_fee*ethprice) as Total_USD_Fee,
avg (tx_fee*ethprice) as Average_USD_Fee,
max (tx_fee*ethprice) as Maximum_USD_Fee,
median (tx_fee*ethprice) as Median_USD_Fee,
sum (tx_count) over (order by date) as Cumulative_TX_Count,
sum (total_eth_fee) over (order by date) as Cumulative_ETH_fee,
sum (total_usd_fee) over (order by date) as Cumulative_USD_Fee
from optimism.core.fact_transactions t1 join ethpricet t2 on t1.block_timestamp::date = t2.day
where block_timestamp >= '2023-01-01'
group by 1,2
union all
select 'Ethereum' as blockchain,
date_trunc(day,block_timestamp) as date,
count (distinct tx_hash) as TX_Count,
count (distinct from_address) as Users_Count,
sum (tx_fee) as Total_ETH_Fee,
avg (tx_fee) as Average_ETH_Fee,
max (tx_fee) as Maximum_ETH_Fee,
Run a query to Download Data