SELECT
date_trunc('week', block_timestamp) as date,
sum(CASE when action LIKE 'delegate' then amount/1e6 end) - sum(CASE when action LIKE 'undelegate' then amount/1e6 end) as "Delegation net volume"
FROM axelar.core.fact_staking
WHERE action in ('delegate', 'undelegate')
AND currency LIKE 'uaxl'
and block_timestamp >= '2022-09-12'
GROUP BY 1
order by 1