with tx_list as (
select
distinct tx_group_id
from algorand.transactions
where asset_id in (0, 694432641)
and tx_type in ('axfer', 'pay')
and tx_type_name in ('asset transfer', 'payment')
)
select
block_timestamp::date as date,
sum(tx_message:txn:aamt/1e6) as total_galgo3
from algorand.transactions
where asset_id = '694432641'
and tx_type_name = 'asset transfer'
and tx_type = 'axfer'
and tx_group_id in (select * from tx_list)
group by 1
order by 1