with cex_addresses as (
select distinct address, label
from algorand.labels
where label_type = 'cex'
and label not like '%group%'
),
transfers as (
select
block_timestamp, tx_id, sender, receiver, amount, label as cex
from algorand.payment_transaction pt
join cex_addresses ca on pt.sender = ca.address
where date(block_timestamp) >= '2022-04-01'
)
select
date_trunc('day', block_timestamp) as date,
case when date>='2022-05-02' then 'after'
else 'before' end as spliter,
count(tx_id) as transactions,
sum(amount) as volume
from transfers
group by date