select trf.contract_address,label.address_name,sum(tx.matic_value)
from polygon.core.fact_token_transfers trf inner join polygon.core.fact_transactions tx
on trf.tx_hash = tx.tx_hash
inner join polygon.core.dim_labels label on label.address=trf.contract_address
where tx.status='SUCCESS'
and trf.block_timestamp::date >= '2021-10-01' and trf.block_timestamp::date <= '2021-10-31'
group by 1,2
order by 3 desc
limit 10