Meir2023-08-18 03:27 AM
    Updated 2023-09-21
    -- 0xb0ce2021785143f268c9eaf39bc957c7a9082d11 -- uni v3 oeth ovg

    with increase as (
    SELECT
    LIQUIDITY_PROVIDER,
    sum(AMOUNT0_ADJUSTED) as oeth_amount,
    sum(AMOUNT1_ADJUSTED) as ovg_amount
    FROM ethereum.uniswapv3.ez_lp_actions
    WHERE TOKEN0_SYMBOL = 'OETH'
    AND ACTION = 'INCREASE_LIQUIDITY'
    GROUP BY LIQUIDITY_PROVIDER

    ),


    decrease as (

    SELECT
    LIQUIDITY_PROVIDER,
    sum(AMOUNT0_ADJUSTED) as oeth_amount,
    sum(AMOUNT1_ADJUSTED) as ovg_amount
    FROM ethereum.uniswapv3.ez_lp_actions
    WHERE TOKEN0_SYMBOL = 'OETH'
    AND ACTION = 'DECREASE_LIQUIDITY'
    GROUP BY LIQUIDITY_PROVIDER
    )





    SELECT
    increase.LIQUIDITY_PROVIDER as lp,
    (increase.oeth_amount - decrease.oeth_amount) as net_oeth,
    (increase.ovg_amount - decrease.ovg_amount) as net_ovg
    FROM increase
    Run a query to Download Data