select
date(block_timestamp) as date ,
sum(STAKE_AMOUNT) as total_unstake,
sum(total_unstake) over (order by date asc) as cumulative_unstake
from near.core.dim_staking_actions
where BLOCK_TIMESTAMP::date > CURRENT_DATE - 90
and ACTION='Unstake'
group by date