amirrzDistribution of Active Users
Updated 2022-10-17Copy 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
table1 as (
select
date_trunc (week,block_timestamp) as Week,
tx_from as Active_Users,
count(distinct block_timestamp::date) as Days_Count
from
osmosis.core.fact_transactions
where
tx_status = 'SUCCEEDED'
group by 1,2
having days_count >= 5),
maintable as (
select
'Swap' as Action_Type,
Trader as User1,
count(distinct tx_id) as TX_Count
from
osmosis.core.fact_swaps
where
tx_status = 'SUCCEEDED'
and
trader in (select active_users from table1) group by 1,2
union ALL
select
'Liquidity Providing' as Action_Type,
liquidity_provider_address as User1,
count(distinct tx_id) as TX_Count
from
osmosis.core.fact_liquidity_provider_actions
where
tx_status = 'SUCCEEDED'
and liquidity_provider_address in (select active_users from table1) group by 1,2)
select
action_type,
case
Run a query to Download Data