Metiocre31. - Sushi and Uni Gas2
    Updated 2022-02-03
    with uniswap_daily as (
    select date(t.block_timestamp) as date, sum(t.gas_used) as total, avg(t.gas_used) as average
    from ethereum.dex_swaps as d , ethereum.transactions as t
    where (datediff(month, date(t.block_timestamp), CURRENT_DATE))<=2 and d.tx_id = t.tx_id and d.platform = 'uniswap-v3'
    group by date(t.block_timestamp)
    order by date(t.block_timestamp) desc
    ),

    sushiswap_daily as (
    select date(t.block_timestamp) as date, sum(t.gas_used) as total, avg(t.gas_used) as average
    from ethereum.dex_swaps as d , ethereum.transactions as t
    where (datediff(month, date(t.block_timestamp), CURRENT_DATE))<=2 and d.tx_id = t.tx_id and d.platform = 'sushiswap'
    group by date(t.block_timestamp)
    order by date(t.block_timestamp) desc
    )

    select u.date as date, u.total as uniswap_total, u.average as uniswap_average, s.total as sushiswap_total, s.average as sushiswap_average
    from uniswap_daily as u, sushiswap_daily as s where u.date = s.date
    order by date(u.date) desc


    Run a query to Download Data