Popex404#5 Avalanche Defi - Distribution of LPs
Updated 2023-08-20
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
›
⌄
with cte as (
SELECT
"Token",
count(distinct pool_address) as "LPs"
from (
SELECT
tokens:token0 as "Token",
pool_address
from avalanche.defi.dim_dex_liquidity_pools
union all
select
tokens:token1 as "Token",
pool_address
from avalanche.defi.dim_dex_liquidity_pools)
where "Token" is not null
group by 1 order by 2 desc)
select
case
when "LPs" = 1 then 'a) 1 LP'
when "LPs" < 6 then 'b) 2-5 LPs'
when "LPs" < 11 then 'c) 6-10 LPs'
when "LPs" < 21 then 'd) 11-20 LPs'
else 'e) >21 LPs' end as "LPs Amount",
count(distinct "Token") as "Tokens",
sum("LPs") as "Liquidity Pools"
from cte
group by 1 order by 1
Run a query to Download Data