0-MIDavg tx fee per day
    Updated 2023-05-21
    with act1 as (
    with tab1 as (
    select BLOCK_TIMESTAMP::date as date
    ,case
    when BLOCK_TIMESTAMP>='2023-05-09' and BLOCK_TIMESTAMP<'2023-05-16' then 'One Week Before Enable'
    when BLOCK_TIMESTAMP>='2023-05-16' and BLOCK_TIMESTAMP<='2023-05-23' then 'One Week After Enable' end as enable_time
    ,TX_HASH as tx
    from ethereum.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS ='0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
    and CONTRACT_NAME='Liquid staked Ether 2.0'
    and EVENT_NAME='Submitted'
    and BLOCK_TIMESTAMP>='2023-05-09' and BLOCK_TIMESTAMP<='2023-05-23'
    and TX_STATUS='SUCCESS'),
    tab2 as (
    select BLOCK_TIMESTAMP::date as date
    ,TX_FEE
    ,TX_HASH
    from ethereum.core.fact_transactions
    where BLOCK_TIMESTAMP>='2023-05-09' and BLOCK_TIMESTAMP<='2023-05-23')
    select tab2.date
    ,enable_time
    ,round(sum(TX_FEE)) as fee
    from tab1
    left join tab2
    on tab1.date=tab2.date
    and tab1.tx=tab2.TX_HASH
    group by 1,2)
    select enable_time
    ,avg(fee) as "Avg Fee"
    from act1
    group by 1

    Run a query to Download Data