select date_trunc ('day',block_timestamp) as date,
action,
count (distinct tx_hash) as TX_Count,
count (distinct tx_signer) as Users_Count,
count (distinct pool_address) as Validators_Count,
sum (stake_amount/1e24) as Volume
from near.core.dim_staking_actions
WHERE block_timestamp::date >= CURRENT_DATE - {{past_days}}
AND block_timestamp::date < CURRENT_DATE
group by 1,2
order by 1