Abbas_ra21Lp stats by New Lpers 2
    Updated 2023-07-03
    -- forked from Lp stats by New Lpers @ https://flipsidecrypto.xyz/edit/queries/b555be04-ec60-438a-b304-2e44e7ceb636

    with
    tb AS (
    select
    LIQUIDITY_PROVIDER AS user,
    min(BLOCK_TIMESTAMP) AS Timedate
    from
    ethereum.uniswapv3.ez_lp_actions
    group by
    1
    having
    Timedate >= dateadd(
    'Month',
    - {{Last_N_Months}},
    current_date
    )
    )
    select
    case
    when ACTION = 'DECREASE_LIQUIDITY' then 'Decrease'
    else 'Increase'
    end AS Action,
    count(*) AS "Events Number",
    sum(AMOUNT0_USD + AMOUNT1_USD) AS "Amount (USD)"
    from ethereum.uniswapv3.ez_lp_actions
    where
    BLOCK_TIMESTAMP >= dateadd(
    'Month',
    - {{Last_N_Months}},
    current_date
    )
    and LIQUIDITY_PROVIDER in (select User from tb)
    group by 1

    Run a query to Download Data