SleepyBig numbers tx&new users
Updated 2023-04-25Copy 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 new_user_reg_dates as (
select
tx_signer,
min(date_trunc('day', block_timestamp)) reg_day
from near.core.fact_transactions
where tx_receiver = 'aurora'
and tx_status = 'Success'
group by tx_signer
),
new_users_per_day as(
select
reg_day day,
count(distinct tx_signer) new_users,
sum(new_users) over(order by day) cum_new_users
from new_user_reg_dates
group by day
),
unique_users_per_day as(
select
date_trunc('day', block_timestamp) day,
count(distinct tx_signer) unique_users
from near.core.fact_transactions
where day >= current_date - 365 and tx_receiver = 'aurora'
and tx_status = 'Success'
--and tx_signer not like '%.aurora'
group by day
order by day
),
tx_per_day as(
select
date_trunc('day', block_timestamp) day,
count(distinct tx_hash) tx_count,
sum(tx_count) over(order by day) cum_tx
from near.core.fact_transactions
where tx_receiver = 'aurora'
and tx_status = 'Success'
Run a query to Download Data