with tbl1 as (select distinct tx_group_id from algorand.transactions where TRY_BASE64_DECODE_STRING(tx_message:txn:apaa[0]::STRING) = 'S')
select count(1), date(block_timestamp) from algorand.transactions where asset_id=571576867
and tx_group_id in (select tx_group_id from tbl1)
group by 2