select
date(t.block_timestamp) as date,
t.tx_receiver as contract_address,
count(distinct t.tx_hash) as transactions,
count(distinct t.tx_signer) as addresses
from
near.core.fact_transactions t
where
date >= current_date - interval '{{Days}} days'
group by 1,2
order by 1 desc, 3 desc