select * from (
select
date_trunc('day',block_timestamp) as date,
origin_function_name as function_called,
count(tx_id) as n_transactions
from
ethereum.udm_events
where contract_address IS NULL
and block_timestamp > getdate() - interval '60 days'
group by 1,2
) etx where etx.n_transactions > 999
order by etx.date desc, etx.n_transactions desc;