with addy as (select from_address
from polygon.transactions
where date(block_timestamp) >= CURRENT_DATE - 30
group by 1)
select date_trunc('day', block_timestamp) as dt, count(distinct from_address) as address, count(distinct tx_id) as tx_count
from polygon.transactions
where from_address in (select from_address from addy) and year(block_timestamp) = '2022'
group by 1