Abbas_ra21Lp stats by New Lpers
    Updated 2023-07-03
    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
    date_trunc('Month', BLOCK_TIMESTAMP) AS Month,
    case
    when ACTION = 'DECREASE_LIQUIDITY' then 'Decrease'
    else 'Increase'
    end AS Action,
    count(DISTINCT LIQUIDITY_PROVIDER) AS "Liquidity providers Number",
    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,2


    Run a query to Download Data