SELECT
date_trunc('month', block_timestamp) as date,
sum(amount) as total_amount,
count(DISTINCT TX_ID) as trx_count,
to_label_type as type
FROM ethereum.udm_events
WHERE event_name = 'transfer'
AND amount > 0
AND symbol = 'DAI'
AND to_label_type not in ('operator', 'chadmin', 'flotsam')
AND to_label_type is not NULL
GROUP by date, to_label_type having total_amount < 50000000000