Last time I flew from YYC (June 2011) the soonest you were permitted to enter pre clearance was two hours, which is a total PITA, because the early morning flights produce a clog. It takes at least 60 minutes early in the morning to clear. I have cleared immigration and customs and security and arrived at the gate while it is boarding after entering the pre clearance hall at exactly T minus two hours.
However, YEG used to be the same way. But like YVR, the order of U.S. pre clearance and security has reversed. So the two hour thing is history. My guess is the same thing is coming to YYC if not already.
Also OP, there is an on airport hotel which is an easy walk to the trans border area. Stay there. If not, yes take a taxi that gets you there at at 3:45 am. Good luck.