select
date_trunc('hour',block_timestamp) as block_hour,
sum(msg_value:execute_msg:send:amount) / pow(10,6) as amount,
'beth_holders_terra' as from_group,
'beth_collateral_anchor' as to_group
from terra.msgs where block_timestamp > '2021-08-12'
and msg_value:execute_msg:send:contract = 'terra10cxuzggyvvv44magvrh3thpdnk9cmlgk93gmx2' -- benth anchor vault contract
and msg_value:execute_msg:send:amount IS NOT NULL
group by 1;