adriaparcerisasThe Unstakeeeeers on Osmosis 2
Updated 2022-07-18
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
users as (
select
tx_caller_address as unstakers,
min(block_timestamp) as unstake_time
from osmosis.core.fact_staking
where action = 'undelegate' and currency = 'uosmo' and tx_status = 'SUCCEEDED'
group by 1
),
redelegations as (
select
tx_caller_address as user
from osmosis.core.fact_staking x
join users y on x.tx_caller_address=y.unstakers and x.block_timestamp>y.unstake_time
where action = 'redelegate' and currency = 'uosmo' and tx_status = 'SUCCEEDED'
group by 1
),
lps as (
select
liquidity_provider_address as user
from osmosis.core.fact_liquidity_provider_actions x
join users y on x.liquidity_provider_address=y.unstakers and x.block_timestamp>y.unstake_time
where action = 'pool_joined' and currency = 'uosmo' and tx_status = 'SUCCEEDED'
group by 1
),
swappings as (
select
trader as user
from osmosis.core.fact_swaps x
join users y on x.trader=y.unstakers and x.block_timestamp>y.unstake_time
where from_currency = 'uosmo' and tx_status = 'SUCCEEDED'
group by 1
)
select 'Redelegators' as users, count(distinct user) as counts from redelegations
union
select 'Loopers' as users, count(distinct user) as counts from lps
Run a query to Download Data