elsinaDistribution of users count who provided liquidity for OP/USDC pool
    Updated 2022-11-16
    with pools as (
    select origin_from_address, sum(lp_token_amount_usd) as amount
    from optimism.velodrome.ez_lp_actions
    where
    pool_address = '0x47029bc8f5cbe3b464004e87ef9c9419a48018cd' and
    lp_action = 'deposit' and
    lp_token_amount_usd is not null
    group by 1
    union all
    select origin_from_address, -sum(lp_token_amount_usd) as amount
    from optimism.velodrome.ez_lp_actions
    where
    pool_address = '0x47029bc8f5cbe3b464004e87ef9c9419a48018cd' and
    lp_action = 'withdraw' and
    lp_token_amount_usd is not null
    group by 1
    ),
    liq as (
    select
    origin_from_address,
    sum(amount) as lp
    from pools
    group by 1 having lp > 0
    )
    select
    case
    when lp > 0 and lp < 10 then '(0, 10)'
    when lp >= 10 and lp < 100 then '[10, 100)'
    when lp >= 100 and lp < 1000 then '[100, 1K)'
    when lp >= 1000 and lp < 10000 then '[1K, 10K)'
    when lp >= 10000 and lp < 100000 then '[10K, 100K)'
    when lp >= 100000 and lp < 1000000 then '[100K, 1M)'
    when lp >= 1000000 and lp < 10000000 then '[1M, 10M)'
    else 'More than 10M' end as dis, count(*) as "count"
    from liq
    group by 1

    Run a query to Download Data