germanGeneral comparison Ethereum vs Optimism
    Updated 2022-10-24
    /*comparison between swaps and transactions on ETH mainnet vs Optimism,
    daily swap volume, daily active users, and average volume swapped (Uniswap).
    L2 is far cheaper, but by how much? What are the average fees for a swap on Optimism compared to ETH Mainnet?*/
    SELECT 'optimism' as chain,
    block_timestamp::date as date,
    count(DISTINCT FROM_ADDRESS) as n_senders,
    count(DISTINCT tx_hash) as n_txs,
    avg(tx_fee) as avg_gas_fee,
    sum(tx_fee) as total_gas_fee
    FROM optimism.core.fact_transactions
    WHERE date >= '2022-05-12'
    GROUP BY date , chain
    UNION
    SELECT 'ethereum' as chain,
    block_timestamp::date as date,
    count(DISTINCT FROM_ADDRESS) as n_senders,
    count(DISTINCT tx_hash) as n_txs,
    avg(tx_fee) as avg_gas_fee,
    sum(tx_fee) as total_gas_fee
    FROM ethereum.core.fact_transactions
    WHERE date >= '2022-05-12'
    GROUP BY date , chain
    ORDER BY date

    Run a query to Download Data