SELECT count
(DISTINCT(user)) number_of_wallets ,
date from (
select TX_ID as user ,block_timestamp::date as date
FROM flow.core.fact_transactions
WHERE block_timestamp
BETWEEN '2022-06-01'
and '2022-07-01'
UNION
select TX_ID as user ,block_timestamp::date as date
FROM flow.core.fact_transactions
WHERE block_timestamp
BETWEEN '2022-06-01'
and '2022-07-01'
)
GROUP by date