Elprognerd1- Overall swaps
    Updated 2023-03-06
    select
    'Arbitrum' as network,
    count(distinct tx_hash) as n_swaps,
    count(distinct Origin_from_address) as n_users,
    count(distinct contract_address) as n_pools,
    n_swaps / n_users as "Number of swaps per user"
    from
    arbitrum.core.fact_event_logs
    where
    origin_to_address = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
    and event_name = 'Swap'
    and tx_status = 'SUCCESS'
    and block_timestamp >= '2023-01-01'
    group by
    1
    UNION ALL

    select
    'Optimism' as network,
    count(distinct tx_hash) as n_swaps,
    count(distinct Origin_from_address) as n_users,
    count(distinct contract_address) as n_pools,
    n_swaps / n_users as "Number of swaps per user"
    from
    optimism.core.fact_event_logs
    where
    origin_to_address = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
    and event_name = 'Swap'
    and block_timestamp >= '2023-01-01'
    group by
    1
    Run a query to Download Data