Claim Rewards

To claim rewards, a staker can call RewardsManager.claimRewards:

/// @notice Claim rewards for a specific stake pool and transfer rewards to `receiver_`.
/// @param stakePoolId_ The ID of the stake pool to claim rewards for.
/// @param receiver_ The address to transfer the claimed rewards to.
function claimRewards(uint16 stakePoolId_, address receiver_) external;

which transfers all of the msg.sender's accrued rewards to the receiver_ address.

Note that claiming rewards claims accrued rewards from all reward pools.

Claim rewards mechanics

On claiming rewards, we follow the following steps for each reward pool:

  • Drip from the reward pool since time may have passed since the last drip.

  • Compute and update the ClaimableRewardsData for the (stake pool, reward pool) pair.

  • Update the UserRewardsData for the (stake pool, reward pool) pair.

  • Transfer the user's accruedRewards from the reward pool to the receiver_.

  • Reset accruedRewards to 0.

  • Emit a ClaimedRewards event.

Last updated