Afonso_Diazuniswap vs alternatives overtime
    Updated 2024-07-30
    with tab1 as (
    select
    block_timestamp::Date AS date,tx_hash,
    amount_in_usd AS amountUSD,
    'uniswap:frontend' AS Platform,
    origin_from_address as userAddress,
    case when date>='2023-10-17' then 'after fee changes' else 'before fee changes' end as TimePeriod
    from optimism.defi.ez_dex_swaps
    where amount_in_usd<power(10,6)
    and tx_hash in (select distinct(tx_hash) from optimism.core.ez_decoded_event_logs where origin_to_address in ('0xcb1355ff08ab38bbce60111f1bb2b784be25d7e8','0x1ba16f6bb1ca9d9b32346e9d51966a606ef21c60','0xb555edf5dcf85f42ceef1f3630a52a108e55a654'))
    and date>='2023-01-01'
    and platform = 'uniswap-v3'

    UNION ALL

    select
    block_timestamp::Date AS date,tx_hash,
    amount_in_usd AS amountUSD,
    Platform,
    origin_from_address as userAddress,
    case when date>='2023-10-17' then 'after fee changes' else 'before fee changes' end as TimePeriod
    from optimism.defi.ez_dex_swaps
    where amount_in_usd<power(10,6)
    and date>='2023-01-01'
    and platform = 'uniswap-v3'
    and AmountUsd BETWEEN 0 AND 100000000
    AND PLATFORM <> 'uniswap-v2'
    AND PLATFORM <> 'uniswap-v3'
    AND YEAR(DATE)>=2023
    )

    SELECT
    DATE_TRUNC('WEEK', DATE) AS DATE,
    PLATFORM,
    COUNT(DISTINCT TX_HASH) AS Txns,
    COUNT(DISTINCT UserAddress) AS Users,
    QueryRunArchived: QueryRun has been archived