superflyUntitled Query
Updated 2022-10-28
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 act1 as (
with tab1 as (
select distinct ORIGIN_FROM_ADDRESS
from ethereum.core.fact_event_logs
where CONTRACT_ADDRESS='0x881d40237659c251811cec9c364ef91dc08d300c'),
tab2 as (
select BLOCK_TIMESTAMP::date as date,ORIGIN_FROM_ADDRESS,TX_HASH
from ethereum.core.ez_dex_swaps
where date>=current_date-360
group by 1,2,3)
select date,TX_HASH
from tab1
left join tab2
on tab1.ORIGIN_FROM_ADDRESS=tab2.ORIGIN_FROM_ADDRESS
group by 1,2),
act2 as (
select TX_HASH,TX_FEE
from ethereum.core.fact_transactions)
select date,avg(TX_FEE)as daily_tx_fee,avg(daily_tx_fee)over (order by date asc)as cumulative_avg_tx_fee
from act1
left join act2
on act1.TX_HASH=act2.TX_HASH
group by 1
Run a query to Download Data