0xHaM-dTotal daily unique users by transaction type
Updated 2022-06-04Copy 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 trans as (
select block_timestamp::date as date,
tx_id as tx,
tx_from
from osmosis.core.fact_transactions
where block_timestamp::date >= '2022-01-01'
)
, msg as (
select block_timestamp::date as date,
msg_type,
tx_id
from osmosis.core.fact_msgs
where block_timestamp::date >= '2022-01-01'
and tx_status = 'SUCCEEDED'
)
, together as (
select a.date,
msg_type,
tx_from
from trans a left outer join msg b on a.tx = b.tx_id
where a.date = b.date
)
, unique_users as (
select min(date) as date,
msg_type,
tx_from
from together
group by 2,3
)
, filtere as (
select trunc(date,'day') as day ,
msg_type ,
count(DISTINCT(tx_from)) as total_unique,
sum(total_unique) over (partition by msg_type order by day asc) as cum_unique_users
from unique_users
group by 1,2
Run a query to Download Data