afonsoUntitled Query
    Updated 2023-01-21
    with arbitrum as (
    select
    date_trunc('week', block_timestamp)::date as day,
    count(distinct tx_hash) as arbitrum_swaps_count,
    count(distinct origin_from_address) as arbitrum_swappers_count
    from arbitrum.core.fact_event_logs
    where event_name = 'Swap'
    group by day
    ),

    ethereum as (
    select
    date_trunc('week', block_timestamp)::date as day,
    count(distinct tx_hash) as ethereum_swaps_count,
    count(distinct origin_from_address) as ethereum_swappers_count
    from ethereum.core.fact_event_logs
    where event_name = 'Swap'
    group by day
    ),

    optimism as (
    select
    date_trunc('week', block_timestamp)::date as day,
    count(distinct tx_hash) as optimism_swaps_count,
    count(distinct origin_from_address) as optimism_swappers_count
    from optimism.core.fact_event_logs
    where event_name = 'Swap'
    group by day
    )

    select *,
    sum(arbitrum_swaps_count) over (order by day asc) as cumulative_arbitrum_swaps_count,
    sum(arbitrum_swappers_count) over (order by day asc) as cumulative_arbitrum_swappers_count,
    sum(ethereum_swaps_count) over (order by day asc) as cumulative_ethereum_swaps_count,
    sum(ethereum_swappers_count) over (order by day asc) as cumulative_ethereum_swappers_count,
    sum(optimism_swaps_count) over (order by day asc) as cumulative_optimism_swaps_count,
    Run a query to Download Data