select
date(block_timestamp) as block_date,
sum(msg_value:execute_msg:borrow_stable:borrow_amount) / pow(10, 6) as borrowed_amount
from terra.msgs
where msg_value:execute_msg:borrow_stable is not null
and tx_status = 'SUCCEEDED'
and block_date > '2021-09-01T00:00:00Z'
-- and,'2021-09-14T00:00:00Z', '2021-09-15T00:00:00Z', '2021-09-16T00:00:00Z')
group by 1