HosseinUntitled Query
Updated 2023-01-02
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
›
⌄
with t1 as (
select
tx_sender,
min(block_timestamp)::date as min_date
from terra.core.fact_transactions
group by tx_sender
),
t2 as (
select
date_trunc('week', min_date)::date as week,
count(distinct tx_sender) as new_wallets,
sum(new_wallets) over (order by week) as cumulative_new_wallets
from t1
group by week
),
t3 as (
select
date_trunc('week', block_timestamp)::date as week,
count(distinct tx_sender) as active_wallets
from terra.core.fact_transactions
group by week
)
select week,
active_wallets,
new_wallets,
cumulative_new_wallets
from t2 join t3
using (week)
order by week asc
Run a query to Download Data