Hi man, I made a script for you with all the data points that you are collecting, I also found an easier way to get the total stake as it had an already made function built right into the hiveengine module.
https://github.com/flaxz/tokeninfo
Just clone the repo and follow the instructions, and dive into how it works if you want, you might fibd what was missing from your own script, it's always great to learn.
!ALIVE
RE: ALIVE weekly tokenomics