select block_timestamp, sum(deposits_in_ust) as total_deposits_in_ust, avg(deposits_in_ust) as average_deposits_in_ust from (
select date_trunc('day', block_timestamp) as block_timestamp, event_attributes:"deposit_amount"/pow(10,6) as deposits_in_ust from terra.msg_events
where event_type = 'wasm' and tx_status='SUCCEEDED' and event_attributes:"0_action"= 'deposit_stable'
and event_attributes:"0_contract_address"='terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s')
group by block_timestamp