Abbas_ra21Saved Fee
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
›
⌄
with tb AS (
select date_trunc('day',BLOCK_TIMESTAMP) AS day,
avg(TX_FEE) AS FEE from ethereum.core.fact_transactions group by 1
)
select
'Arbitrum' AS CHAIN,
date_trunc('day',BLOCK_TIMESTAMP) AS day,
count(*) AS "TX number",
sum(TX_FEE) AS "Fee",
sum(Fee) AS "ETH Fee",
"ETH Fee"-"Fee" AS "saved Fee"
from arbitrum.core.fact_transactions A inner join tb B on date_trunc('day',BLOCK_TIMESTAMP)=B.DAY
where day >= dateadd('month',-3,CURRENT_DATE)
group by 2
union ALL
select
'Optimism' AS CHAIN,
date_trunc('day',BLOCK_TIMESTAMP) AS day,
count(*) AS "TX number",
sum(TX_FEE) AS "Fee",
sum(Fee) AS "ETH Fee",
"ETH Fee"-"Fee"AS "saved Fee"
from optimism.core.fact_transactions A inner join tb B on date_trunc('day',BLOCK_TIMESTAMP)=B.DAY
where day >= dateadd('month',-3,CURRENT_DATE)
group by 2
Run a query to Download Data