select
date_trunc('week', a.block_timestamp)::date as day,
label as description,
sum(a.amount/1e6) as total_volume,
sum(total_volume) over (partition by label order by day) as cumulative_volume
from osmosis.core.fact_staking a
left outer join osmosis.core.fact_validators b
join osmosis.core.fact_transfers c
on address = validator_address
and a.delegator_address = c.receiver
where action = 'undelegate'
and year(a.block_timestamp) >= 2022
and c.currency = 'ibc/D176154B0C63D1F9C6DCFB4F70349EBF2E2B5A87A05902F57A6AE92B863E9AEC'
group by 1, 2
order by 1 asc