SELECT hour(block_timestamp) as hours,
dayofweek(block_timestamp) as weekday,
count(DISTINCT tx_hash) as n_swaps
FROM near.core.ez_dex_swaps
WHERE date_trunc('day',block_timestamp) between CURRENT_DATE-366 AND CURRENT_DATE-1
GROUP BY hours,weekday
ORDER BY hours, weekday