Insert any matching bitcoin into your database with the associated time. Then you can sum/avg/aggregate it by time (within [epoch seconds] - [epoch seconds + 3600])
Wasn't much of an issue for me but since he is somewhat new I imagine reading a stream and basically doing an infinite foreach would be a tad easier than adding queuing, API ratelimits (per hour? forget which), timed polling, etc.