select d as month, avg(n_txn) as avg_txn, max(n_txn) as max_txn
from (Select date_trunc('month',block_timestamp) as d, from_address, address, count(tx_id) as n_txn
from flipside_prod_db.polygon.transactions tr
left join flipside_prod_db.polygon.labels L
on tr.from_address=l.address
where address is null
group by 1,2,3 )
group by 1 order by 1