with
news as (
SELECT
distinct FROM_ADDRESS as users,
min(trunc(block_timestamp,'d')) as debut
from monad.testnet.fact_transactions
-- WHERE block_timestamp < trunc(current_date,'hour')
group by 1
),
news2 as (
select distinct debut,
count(distinct users) as new_users
from news group by 1
),
actives as (
SELECT
trunc(block_timestamp,'d') as week,
count(distinct FROM_ADDRESS) as active_users
from monad.testnet.fact_transactions x
-- WHERE block_timestamp < trunc(current_date,'hour')
group by 1 order by 1 desc
)
select
week,
active_users,
new_users
from actives a
join news2 n on a.week=n.debut
-- WHERE week <
order by 1 asc