MostafaUntitled Query
Updated 2022-07-19Copy 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 undelegate as (
select
tx_caller_address as wallets,
min(block_timestamp) as d1
from osmosis.core.fact_staking
where action = 'undelegate'
and currency = 'uosmo'
and tx_status = 'SUCCEEDED'
group by 1 ),
liquidity as (
select
liquidity_provider_address as wallets
from osmosis.core.fact_liquidity_provider_actions a
join undelegate b on a.liquidity_provider_address=b.wallets
and a.block_timestamp>b.d1
where action = 'pool_joined' and currency = 'uosmo' and tx_status = 'SUCCEEDED' group by 1),
redelegate as (
select
tx_caller_address as wallets
from osmosis.core.fact_staking a
join undelegate b on a.tx_caller_address=b.wallets
and a.block_timestamp>b.d1
where action = 'redelegate' and currency = 'uosmo' and tx_status = 'SUCCEEDED' group by 1 ),
swap as (
select
trader as wallets
from osmosis.core.fact_swaps a
join undelegate b on a.trader=b.wallets
and a.block_timestamp>b.d1
where from_currency = 'uosmo' and tx_status = 'SUCCEEDED' group by 1
)
select 'Swaps' as actions,
count(distinct wallets) as counts from swap
union
select 'Redelegates' as actions,
count(distinct wallets) as counts from redelegate
Run a query to Download Data