mz0111osmo 3
Updated 2022-10-20Copy 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
›
⌄
--credit : 0xHaM☰d
with active_user as (
select
date_trunc('week', block_timestamp)::date as date,
tx_from as active_users,
count(distinct block_timestamp::date) as dt_cnt
from osmosis.core.fact_transactions
group by 1, 2
having dt_cnt >= 5
)
, activity as (
select
date_trunc('week', block_timestamp)::date as date,
'Swap' as status,
tx_id,
TRADER as users
from osmosis.core.fact_swaps
where TRADER in (select active_users from active_user)
union all
select
date_trunc('week', block_timestamp)::date as date,
'LP' as status,
tx_id,
liquidity_provider_address as users
from osmosis.core.fact_liquidity_provider_actions
where liquidity_provider_address in (select active_users from active_user)
union all
select
date_trunc('week', block_timestamp)::date as date,
'Stake' as status,
tx_id,
Run a query to Download Data