Updated 2022-10-27
    SELECT
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    -- platform,
    COUNT(distinct TX_HASH) as tx_count,
    sum(IFF(abs(AMOUNT_IN_USD) > pow(10,9), abs(AMOUNT_IN_USD)/pow(10,18), abs(AMOUNT_IN_USD))) as AMOUNT_USD,
    sum(AMOUNT_USD) over (order by date asc rows between unbounded preceding and current row) as cum_swap_volume_usd,
    sum(tx_count) over (order by date asc rows between unbounded preceding and current row) as cum_swap_volume
    FROM
    ethereum.core.ez_dex_swaps
    WHERE platform = 'uniswap-v2' and date >= '2021-05-05'
    --or platform = 'uniswap-v3'
    --and date >= '2022-01-01'
    GROUP BY date
    /*
    SELECT
    TX_HASH,
    AMOUNT_OUT_USD
    FROM
    ethereum.core.ez_dex_swaps
    WHERE platform = 'uniswap-v3' and AMOUNT_OUT_USD > 6000000000
    order by 2 desc
    limit 50 */
    Run a query to Download Data