with tbl AS
(
select
FROM_ADDRESS as address,
date_trunc (day, block_timestamp) as date,
count (DISTINCT tx_hash) as tx_no,
tx_hash
from polygon.core.fact_transactions
where FROM_ADDRESS = lower('{{ADDRESS}}')
AND to_address = '0x68bdee1bf95ad730f379a05eb8c51fb5dfa07748'
group by 1,2,4
order by date desc
)
SELECT date,
tx_no
from tbl
group by 1,2
order by date desc