elsinaDistribution of users count who provided liquidity for OP/USDC pool
Updated 2022-11-16
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
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