maybeyonaseth_rem_uni_swaps
    Updated 2022-09-18
    -- positive inflows to protocol

    with swaps as (
    select
    block_timestamp,
    tx_hash,
    case
    when token0_symbol = 'WETH' then amount0_adjusted
    when token1_symbol = 'WETH' then amount1_adjusted
    else 'sus' end as amt,
    case when amt <0 then 'out' else 'in' end as direction,
    case
    when token0_symbol = 'WETH' then token1_symbol
    when token1_symbol = 'WETH' then token0_symbol
    else 'sus' end as token
    from ethereum.uniswapv3.ez_swaps
    where (token0_symbol = 'WETH' or token1_symbol ='WETH')
    )

    select *,
    case when net_vol < 0 then 'out' else 'in' end as direction
    from (
    select
    date(block_timestamp) as date,
    -- direction,
    sum(amt) as net_vol
    from swaps
    group by 1
    order by date desc
    limit 180
    )