Hello everyone!

I was tasked with creating a staking contract with an ability to add multiple pools with fixed APR. Never making it before I've chosen MasterChef contract and discovered that it is virtually impossible to set APR fixed. rewardPerBlock, amount of pools and users staking - all this influences amount of rewards users will get.

Now my questions are:
• Is it possible to make APR fixed in MasterChef? Seems likely but not without some backend that will change rewardPerBlock taking in consideration amount of pools and users staking atm.
• Should I just give up this idea and create my own staking contract with different logic as MasterChef seems to be not suitable for my case?

Apr 25, 2022, 6:17 AM
You could use MasterChef. Fixed APR actually simplifies the calculation logic. It might be something like this: check/update a timestamp whenever a user changes their stake balance, calculate earnings based on a fixed APR approach, and then mint the earnings directly to the user.
Apr 25, 2022, 6:37 AM
Thank you, William
Apr 25, 2022, 7:03 AM

© 2024 Draquery.com All rights reserved.