Updated 2024-07-25
    with sell as (
    SELECT
    DATE_TRUNC('day', BLOCK_TIMESTAMP) as date2,
    sum (AMOUNT_OUT_USD) as selll,

    from ethereum.defi.ez_dex_swaps
    where TOKEN_OUT = '0x4123a133ae3c521fd134d7b13a2dec35b56c2463'
    --or TOKEN_IN = '0x4123a133ae3c521fd134d7b13a2dec35b56c2463'
    group by 1
    order by 1
    ),

    buy as ( SELECT
    DATE_TRUNC('day', BLOCK_TIMESTAMP) as date1,
    sum (AMOUNT_IN_USD) as buyy,
    from ethereum.defi.ez_dex_swaps
    where TOKEN_IN = '0x4123a133ae3c521fd134d7b13a2dec35b56c2463'
    --or TOKEN_IN = '0x4123a133ae3c521fd134d7b13a2dec35b56c2463'
    group by 1
    order by 1
    )

    select
    buy.date1 as date, sell.selll as "token sell volume" ,
    buy.buyy as "token buy volume"

    from buy
    full join sell on buy.date1=sell.date2
    --where date <= 2024-04-12
    order by 1



    Auto-refreshes every 12 hours
    QueryRunArchived: QueryRun has been archived