yasmin-n-d-r-hosss1
Updated 2022-10-25Copy Reference Fork
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 lst_LPers as (
select
block_timestamp :: date as day,
(
select
min(PROJECT_NAME)
from
osmosis.core.dim_labels
where
ADDRESS = CURRENCY
) as token,
count (
DISTINCT LIQUIDITY_PROVIDER_ADDRESS
) as wallet,
sum(
case when ACTION = 'pool_joined' then AMOUNT / pow(10, decimal) when ACTION = 'pool_exited' then -1 * AMOUNT / pow(10, decimal) else 0 end
) as amount_lp
from
osmosis.core.fact_liquidity_provider_actions
where
TX_STATUS = 'SUCCEEDED'
and ACTION in('pool_joined')
group by
1,
2)
select
count(wallet) as address,
sum (amount_lp) as sum_amount_lp,
case when amount_lp < 1 then '1.Shimp' when amount_lp >= 1
and amount_lp < 10 then '2.Crab' when amount_lp >= 10
and amount_lp < 100 then '3.Octopus' when amount_lp >= 100
and amount_lp < 1000 then '4.Fish' when amount_lp >= 1000
and amount_lp < 10000 then '5.Shark' when amount_lp >= 10000 then '6.Whale' end as type
from
lst_LPers
Run a query to Download Data