potmodaily total fees and median price
    Updated 2022-10-25
    with swap_txs as (
    select distinct tx_hash
    from optimism.sushi.ez_swaps
    where block_timestamp::date > current_date() -90
    ),
    fees as (
    select block_timestamp::date as date,
    tx_hash, tx_fee, gas_price
    from optimism.core.fact_transactions
    where block_timestamp::date > current_date() -90
    )
    select f.date, sum(tx_fee), avg(tx_fee), median(tx_fee), median(gas_price)
    from swap_txs
    left join
    fees f
    using(tx_hash)
    group by 1
    Run a query to Download Data