hopper-staking
Reward-per-token staking math for Hopper programs. Accumulators, emission
rates, pending rewards, and reward debt are all expressed as pure no_std,
no_alloc, BPF-safe helpers.
Part of the Hopper framework.
This is the standard accumulator pattern with u128 precision and checked
updates. Pool state and per-user debt update in O(1), so stake, unstake, and
claim handlers never iterate over depositors.
use ;
pool.reward_per_token = update_reward_per_token?;
let pending = pending_rewards?;
user.reward_debt = update_reward_debt;
Docs: https://docs.rs/crate/hopper-staking/0.1.0
License: Apache-2.0.