Skip to main content

Crate jiminy_staking

Crate jiminy_staking 

Source
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.