WITH AtomAction As (
select sum(AMOUNT/1e6) Sum_Amount,count(*) As Cnt,ACTION
from osmosis.core.fact_staking_rewards
where CURRENCY='ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' and BLOCK_TIMESTAMP::date >='2022-10-01'
group by Action)
select * from AtomAction