LordkingDAI/USDC.5
    Updated 2023-05-02

    with
    a as
    (
    select
    case
    when AMOUNT0_USD <= 0 then 'USDC => DAI'
    when AMOUNT0_USD > 0 then 'DAI => USDC' end as Swap,
    count (distinct tx_hash) as tx_hashs,
    count (distinct RECIPIENT) as trader,
    sum (case when AMOUNT0_USD > 0 then AMOUNT0_USD else AMOUNT1_USD end) as AMOUNT_USD

    from ethereum.uniswapv3.ez_swaps
    where POOL_ADDRESS ilike '%0x5777d92f208679db4b9778590fa3cab3ac9e2168%'
    and AMOUNT0_USD is NOT NULL
    and BLOCK_TIMESTAMP > current_date -30
    GROUP BY Swap )

    select *
    from a

    Run a query to Download Data