select count(distinct tx_hash) as total_contract,
date_trunc('week', block_timestamp) as date,
sum(total_contract) over (order by date) as cumulative_contracts
from near.core.fact_actions_events
where ACTION_NAME='DeployContract'
and date >= CURRENT_DATE - 180
group by date