select
--date(block_timestamp) as date,
e.program_id,
l.label,
count(distinct tx_id) as txs
from solana.core.fact_events e
left join solana.core.dim_labels l
on e.program_id = l.address
where
date(block_timestamp) between current_date()-31 and current_date()-1
group by e.program_id,l.label
order by txs DESC
limit 10