Updated 2022-10-15
    select
    date_trunc('{{Interval}}', block_timestamp)::date as date,
    'Uni on Optimism' as dex,
    count(distinct tx_hash) as swap_count,
    count(distinct origin_from_address) as unique_swappers,
    sum(swap_count) over (order by date asc) as cum_swap_count,
    sum(unique_swappers) over (order by date asc) as cum_unique_swapper
    from optimism.core.fact_event_logs
    where origin_to_address IN ('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45',
    '0xe592427a0aece92de3edee1f18e0157c05861564') -- I found two addresses for Uniswap: both yield a lot of transactions.
    and event_name = 'Swap'
    and tx_status = 'SUCCESS'
    and block_timestamp::date >= CURRENT_DATE - {{n_day}}
    group by 1
    UNION ALL
    select
    date_trunc('{{Interval}}', block_timestamp)::date as date,
    'Uni on Arbitrum' as dex,
    count(distinct tx_hash) as swap_count,
    count(distinct origin_from_address) as unique_swappers,
    sum(swap_count) over (order by date asc) as cum_swap_count,
    sum(unique_swappers) over (order by date asc) as cum_unique_swapper
    from arbitrum.core.fact_event_logs
    where origin_to_address IN ('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45',
    '0xe592427a0aece92de3edee1f18e0157c05861564') -- I found two addresses for Uniswap: both yield a lot of transactions.
    and event_name = 'Swap'
    and tx_status = 'SUCCESS'
    and block_timestamp::date >= CURRENT_DATE - {{n_day}}
    group by 1
    UNION ALL
    select
    date_trunc('{{Interval}}', block_timestamp)::date as date,
    Run a query to Download Data