Updated 2022-10-16
    select
    BLOCK_TIMESTAMP::date as day,
    'Sushiswap' as DEX,
    count(distinct tx_hash) as no_swaps,
    count(distinct ORIGIN_FROM_ADDRESS) as no_users,
    sum(no_swaps) over (order by day) as cum_swap_count,
    sum(no_users) over (order by day) as cum_users_count,
    no_swaps/no_users swap_per_user
    from Optimism.core.fact_event_logs s left join Optimism.core.dim_labels b on s.CONTRACT_ADDRESS=b.address
    where PROJECT_NAME ilike '%sushiswap%'
    group by 1
    union all
    select
    BLOCK_TIMESTAMP::date as day,
    'Uniswap' as DEX,
    count(distinct tx_hash) as no_swaps,
    count(distinct ORIGIN_FROM_ADDRESS) as no_users,
    sum(no_swaps) over (order by day) as cum_swap_count,
    sum(no_users) over (order by day) as cum_users_count,
    no_swaps/no_users swap_per_user
    from Optimism.core.fact_event_logs s left join Optimism.core.dim_labels b on s.CONTRACT_ADDRESS=b.address
    where PROJECT_NAME ilike '%uniswap%'
    group by 1
    Run a query to Download Data