boomer77swap volume v2
    Updated 2021-08-04
    with swapin as
    (SELECT
    date_trunc('day',block_timestamp) as date,
    sum(amount_usd) as IN_USD,
    direction,
    platform
    from ethereum.dex_swaps
    where amount_usd < 20000000 and platform = 'uniswap-v2' and direction = 'IN'
    group by 1,3,4),
    swapout as
    (SELECT
    date_trunc('day',block_timestamp) as date,
    sum(amount_usd) as usd,
    concat('-',usd) as OUT_USD,
    direction,
    platform
    from ethereum.dex_swaps
    where amount_usd < 20000000 and platform = 'uniswap-v2' and direction = 'OUT'
    group by 1,4,5)

    select A.date, A.IN_USD, B.OUT_USD
    from swapin A
    join swapout B on A.date = B.date
    order by 1 desc
    Run a query to Download Data