afonsoDaily ETH swap Numbers
    Updated 2023-01-20
    with t as (
    select
    block_timestamp::date as day,
    'Swap FROM ETH' as action,
    platform,
    count(distinct tx_hash) as swaps_count,
    count(distinct sender) as swappers_count,
    sum(amount_in_usd) as total_amount_usd,
    avg(amount_in_usd) as average_amount_usd,
    sum(swaps_count) over (partition by platform order by day) as cumulative_swaps_count,
    sum(swappers_count) over (partition by platform order by day) as cumulative_swappers_count,
    sum(total_amount_usd) over (partition by platform order by day) as cumulative_amount_usd
    from ethereum.core.ez_dex_swaps
    where event_name = 'Swap'
    and symbol_in = 'WETH'
    group by day, platform

    union all

    select
    block_timestamp::date as day,
    'Swap TO ETH' as action,
    platform,
    count(distinct tx_hash) as swaps_count,
    count(distinct sender) as swappers_count,
    sum(amount_out_usd) as total_amount_usd,
    avg(amount_out_usd) as average_amount_usd,
    sum(swaps_count) over (partition by platform order by day) as cumulative_swaps_count,
    sum(swappers_count) over (partition by platform order by day) as cumulative_swappers_count,
    sum(total_amount_usd) over (partition by platform order by day) as cumulative_amount_usd
    from ethereum.core.ez_dex_swaps
    where event_name = 'Swap'
    and symbol_out = 'WETH'
    group by day, platform
    )

    Run a query to Download Data