0

I'm currently working on a staking contract and would like to get EVERY SECOND the updated number of rewards the user gets for staking tokens.

Are there any technical limitations to get the updated rewards every second from a public function using block.timestamp? So far I was only able to get the updated reward with 18 decimals every 10 seconds on the Rinkeby testnet, is then something wrong with my calculation or is this because of the limitations of the block speed?

0

Well rewards are updated every block, now there's nothing preventing you to update the rewards on your frontend every second (just take the previous block rewards and divide it by the block time in seconds) but that would end up being off the real amount (rewards arent the same on every block) and that's just a number on your website. The actual rewards will update every 10 seconds no matter what

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.