SELECT date_trunc('day', BLOCK_TIMESTAMP) as date, TX_RECEIVER, COUNT(DISTINCT TX_HASH) as tx_count, sum(TRANSACTION_FEE/pow(10,24)) as total_fee,
row_number() over (partition by date order by total_fee DESC) as r
from near.core.fact_transactions
where date >= '2022-06-01'
GROUP by date, TX_RECEIVER
qualify r <= 5