ola_27_ weekly unique users, volume, avg size, median size
    Updated 2024-07-15
    with t1 as (
    select
    date_trunc('week', block_timestamp) as week,
    'Arbitrum' as chain,
    count(distinct origin_from_address) as unique_users,
    count(distinct pool_name) as active_pools,
    sum(amount_in_usd) as total_volume,
    avg(amount_in_usd) as avg_volume,
    median(amount_in_usd) as median_volume
    from
    arbitrum.defi.ez_dex_swaps
    where
    platform ilike '%uniswap%'
    and block_timestamp::date < '2024-01-19'
    group by
    1
    union
    all
    select
    date_trunc('week', block_timestamp) as week,
    'Avalanche' as chain,
    count(distinct origin_from_address) as unique_users,
    count(distinct pool_name) as active_pools,
    sum(amount_in_usd) as total_volume,
    avg(amount_in_usd) as avg_volume,
    median(amount_in_usd) as median_volume
    from
    avalanche.defi.ez_dex_swaps
    where
    platform ilike '%uniswap%'
    and block_timestamp::date < '2024-01-19'
    group by
    1
    union all
    select
    date_trunc('week', block_timestamp) as week,