PapasotLiquidity: USD Volume Per Pool - Daily
    Updated 2022-01-16
    -- This query shows total liquidity being deposited and withdrawn from each individual Uniswap V3 Pools each day
    WITH liquidity_pool AS (
    SELECT
    tx_id,
    date_trunc('day', block_timestamp) AS date,
    action,
    pool_address,
    pool_name,
    token0_address,
    token1_address,
    token0_symbol,
    token1_symbol,
    amount0_adjusted,
    amount1_adjusted,
    amount0_usd,
    amount1_usd,
    (amount0_usd + amount1_usd) AS add_amount_total
    FROM uniswapv3.lp_actions
    ),
    add_liquidity AS (
    SELECT
    date,
    pool_address,
    pool_name,
    SUM(add_amount_total) AS total_deposit
    FROM liquidity_pool
    WHERE action = 'INCREASE_LIQUIDITY'
    GROUP BY 1,2,3
    ),
    remove_liquidity AS (
    SELECT
    date,
    pool_address,
    pool_name,
    -SUM(add_amount_total) AS total_withdrawl
    FROM liquidity_pool
    Run a query to Download Data