select *, datediff(minute, min_date, max_date) as duration
from (select min(block_timestamp) as min_date,
max(block_timestamp) as max_date,
count(distinct tx_id) as num_payments,
sum(amount) as amount,
sum(fee) as fees
from algorand.payment_transaction
where block_timestamp::date > '2022-03-30'
and try_base64_decode_string(tx_message:txn:note::string) like '%af/gov1:j{"rewardsPrd":2%'
)