MLDZMNDaily swap volume
    Updated 2022-12-05
    with times as (with tb1 as (SELECT
    SYMBOL_IN as coins

    from ethereum.sushi.ez_swaps
    union ALL
    SELECT
    SYMBOL_OUT as coins

    from ethereum.sushi.ez_swaps)

    select
    distinct SYMBOL,
    TOKEN_ADDRESS,
    avg(price)as aag
    from flipside_prod_db.ethereum_core.fact_hourly_token_prices
    where SYMBOL in (select coins from tb1)
    group by 1,2 having aag between 0.99 and 1.01),

    tb1 as(SELECT
    BLOCK_TIMESTAMP::date as day,
    SYMBOL_IN as coins,
    sum(AMOUNT_IN_USD) as volume_in

    from ethereum.sushi.ez_swaps
    where SYMBOL_IN in (select SYMBOL from times)
    and BLOCK_TIMESTAMP>=CURRENT_DATE-90
    group by 1,2
    ),

    tb2 as(SELECT
    BLOCK_TIMESTAMP::date as day,
    SYMBOL_OUT as coins,
    sum(AMOUNT_OUT_USD) as volume_out

    from ethereum.sushi.ez_swaps
    where SYMBOL_OUT in (select SYMBOL from times)
    Run a query to Download Data