Elprognerd2 daily
    Updated 2023-03-06
    select
    date_trunc('day', block_timestamp) as date,
    '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,
    sum(n_swaps) over (order by date) as n_cumulative_swap,
    sum(n_users) over (order by date) as n_cumulative_swappers
    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, 2

    UNION ALL
    select
    date_trunc('day', block_timestamp) as date,
    '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,
    sum(n_swaps) over (order by date) as n_cumulative_swap,
    sum(n_users) over (order by date) as n_cumulative_swappers
    from optimism.core.fact_event_logs
    where origin_to_address = '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
    and event_name = 'Swap'
    and block_timestamp >= '2023-01-01'
    group by 1, 2
    order by 1


    Run a query to Download Data