with raw as (
select
date_trunc('month', block_timestamp) as month,
tx_from[0] as wallet,
count(tx_id) as tx_count
from terra.transactions
where block_timestamp >= '2022-01-01'
group by 1,2
), active_wallets as (
select *
from raw
where tx_count > 1
)
select month, count(distinct wallet)
from active_wallets
group by 1
-- order by 1