Afonso_Diaz2023-09-09 07:28 PM
    Updated 2023-09-27
    with t as (
    select
    liquidity_provider as user
    from ethereum.uniswapv3.ez_lp_actions
    group by 1
    having count(distinct iff(action = 'INCREASE_LIQUIDITY', tx_hash, null))
    - count(distinct iff(action = 'DECREASE_LIQUIDITY', tx_hash, null)) > 0
    )

    select
    'Active users' as type,
    count(distinct user) as users
    from t
    group by 1

    union all

    select
    'Inactive users' as type,
    count(distinct liquidity_provider) as users
    from ethereum.uniswapv3.ez_lp_actions
    where liquidity_provider not in (select distinct user from t)
    group by 1
    Run a query to Download Data