Correction of the staking algorithm in a smart contract for DeFI

Job ID: 32292285

Budget: $250 – $750 USD

I have smart contracts for DeFI dapps.
One for ERC20 token, the other is Staking contract.
But there is a mistake while calculating rewards so that the total balance does not keep equilibrium between minting and rewarding.
It is core tech in DeFI trading.
I need to make staking contracts with test cases.
Please bid if you can make exact and correct staking algorithm in smart contracts.
Deliver smart contracts and its testing environment with detailed description.
Thank you.
Related categories: Bitcoin Blockchain Ethereum Solidity Smart Contracts