select sum(AMOUNT/1e6) as amount_undelegated, count(distinct DELEGATOR_ADDRESS) as user_count,
date_trunc('week', block_timestamp) as block_week
from osmosis.core.fact_staking
where block_timestamp>= '2022-01-01'
and ACTION ='undelegate'
group by block_week