0-MIDfee amount
    Updated 2022-06-28
    with meta as (
    with metamask_users as (
    select distinct ORIGIN_FROM_ADDRESS
    from ethereum.core.fact_event_logs
    where CONTRACT_ADDRESS='0x881d40237659c251811cec9c364ef91dc08d300c'),
    swappers as (
    select BLOCK_TIMESTAMP::date as date,ORIGIN_FROM_ADDRESS as swappers,AMOUNT_IN_USD,TX_HASH
    from ethereum.core.ez_dex_swaps
    where date>=current_date-90
    group by 1,2,3,4)
    select TX_HASH
    from metamask_users
    left join swappers
    on metamask_users.ORIGIN_FROM_ADDRESS=swappers.swappers
    group by 1)
    select BLOCK_TIMESTAMP::date as date,avg(TX_FEE)as fee_amount,avg(fee_amount) over (order by date asc)as total_avx_fee
    from ethereum.core.fact_transactions
    where date>=current_date-90
    and TX_HASH in (select TX_HASH from meta)
    group by 1



    Run a query to Download Data