mucryptoUntitled Query
    Updated 2023-02-18
    with dex as (
    select
    date_trunc('day', block_timestamp) as date,
    pool_name,
    token_in,
    token_out,
    symbol_in,
    symbol_out
    from
    ethereum.core.ez_dex_swaps
    where block_timestamp::date between '2022-05-04' and '2022-05-15'
    ),

    pairs as (
    select
    date,
    pool_name,
    case
    when symbol_in = 'USDC' and symbol_out = 'WETH' then 'USDC-WETH'
    else 'Other'
    end as pair_symbol
    from dex
    )

    select
    date,
    count(pair_symbol) as n_of_swaps,
    pair_symbol
    from pairs
    group by 1,3
    order by 1
    Run a query to Download Data