I'm implementing a smart contract that allows users to stake one ERC20 token and receive rewards in another ERC20 token from a pool that is funded by accumulated transaction fees by the protocol.
What's the best/easiest way or an example to calculate stakers' rewards, considering their rewards will be entirely based on user activity/accumulated transaction fees?
In other words, stakers' rewards are not constant as in the event of no transactions on the protocol, there will be zero increase in the total available rewards.
The current prominent staking contracts appear to be based on rewardsPerBlock or rewardsPerToken models, but this does not seem to be relevant to what I'm trying to achieve. Am I missing a trick here?