sepehrmhz8Untitled Query
Updated 2022-10-19
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 eth_price as (select hour::date as day,
avg (price) as eth_price_
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1),
matic_price as (select hour::date as day,
avg (price) as matic_price_
from ethereum.core.fact_hourly_token_prices
where symbol = 'MATIC'
group by 1)
select 'Optimism' as Net,
sum (tx_fee * eth_price_) as Total_Fee,
avg (tx_fee * eth_price_) as Average_Fee
from optimism.core.fact_transactions a join eth_price b on a.block_timestamp::date = b.day
where block_timestamp >= '2022-06-01'
group by 1
union all
select 'Arbitrum' as Net,
sum (tx_fee * eth_price_) as Total_Fee,
avg (tx_fee * eth_price_) as Average_Fee
from arbitrum.core.fact_transactions a join eth_price b on a.block_timestamp::date = b.day
where block_timestamp >= '2022-06-01'
group by 1
union all
select 'Polygon' as Net,
sum (tx_fee * matic_price_) as Total_Fee,
avg (tx_fee * matic_price_) as Average_Fee
from polygon.core.fact_transactions a join matic_price b on a.block_timestamp::date = b.day
where block_timestamp >= '2022-06-01'
group by 1
Run a query to Download Data