Expand description
§jiminy-staking
MasterChef-style reward accumulators.
Reward-per-token accumulator, emission rates, pending rewards, and reward debt tracking. The same math everyone copies from MasterChef, except you don’t have to re-derive it from another Solana program. u128 precision throughout.
Re-exports§
pub use pinocchio;
Constants§
- REWARD_
PRECISION - Scaling factor for reward-per-token accumulator (1e12).
Functions§
- emission_
rate - Calculate the emission rate (rewards per second).
- pending_
rewards - Calculate a user’s pending (claimable) rewards.
- rewards_
earned - Calculate rewards earned since the last update, given an emission rate and elapsed time.
- update_
reward_ debt - Compute the reward debt for a user after staking or claiming.
- update_
reward_ per_ token - Update the global reward-per-token accumulator.