boomer77Top 5 Pool Weekly Changes
    Updated 2021-08-03
    WITH swap_raw AS (
    SELECT
    date_trunc('week', block_timestamp) as weeks,
    pool_address,
    pool_name,
    CASE WHEN amount0_usd < 0 THEN amount0_usd ELSE amount1_usd END AS swap_usd_amount_out,
    CASE WHEN amount0_usd >= 0 THEN amount0_usd ELSE amount1_usd END AS swap_usd_amount_in
    FROM uniswapv3.swaps
    WHERE amount0_usd IS NOT NULL AND amount1_usd IS NOT NULL
    )
    -- // Only amount in
    SELECT
    weeks,
    pool_address,
    pool_name,
    SUM(ABS(swap_usd_amount_in)) AS swap_volume_usd
    FROM swap_raw
    where pool_address in ('0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640', '0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8','0x11b815efb8f581194ae79006d24e0d814b7697f6','0x4e68ccd3e89f51c3074ca5072bbac773960dfa36','0x60594a405d53811d3bc4766596efd80fd545a270')
    GROUP BY 1,2,3
    order by 4 DESC
    Run a query to Download Data