reza2085OPEN ETH 3
    Updated 2022-10-03
    with t as (
    select BLOCK_TIMESTAMP,
    TX_HASH,
    ACTION,
    LIQUIDITY_PROVIDER,
    POOL_NAME,
    case when TOKEN0_SYMBOL = 'WETH' then AMOUNT0_ADJUSTED when TOKEN1_SYMBOL = 'WETH' then AMOUNT1_ADJUSTED end as Amount
    from ethereum.uniswapv3.ez_lp_actions
    where (TOKEN0_SYMBOL = 'WETH' or TOKEN1_SYMBOL = 'WETH')
    and BLOCK_TIMESTAMP::DATE >= '2022-07-01' and BLOCK_TIMESTAMP::DATE < CURRENT_DATE and Amount > 0
    ),
    D as (
    select
    date_trunc('day', block_timestamp) as day,
    sum(Amount) as eth_amount,
    count(distinct TX_HASH) as d_txCount,
    count(distinct LIQUIDITY_PROVIDER) as Depositors
    from t
    where ACTION = 'INCREASE_LIQUIDITY'
    group by 1
    ),
    W as (
    select
    date_trunc('day', block_timestamp) as day,
    sum(Amount) as eth_amount,
    count(distinct TX_HASH) as w_txCount,
    count(distinct LIQUIDITY_PROVIDER) as Withdrawers
    from t
    where ACTION = 'DECREASE_LIQUIDITY'
    group by 1
    ),

    F as (select D.day,
    case WHEN D.day >= '2022-09-01' and D.day < '2022-09-15' THEN 'Two weeks before the merge' WHEN D.day < '2022-09-01' THEN 'Before merge' ELSE 'After merge' end as Period,
    Run a query to Download Data