Redeem Undripped Rewards
Depositors are able to redeem undripped rewards from a Rewards Manager. On a redemption:
The depositor's receipt tokens are burned.
Undripped reward assets are transferred to the specified receiver address.
Using CozyRouter to redeem undripped rewards
The recommended way to programmatically deposit rewards assets is to call CozyRouter.redeemRewardPoolDepositReceiptTokens
(see CozyRouter):
This method will internally call RewardsManager.redeemUndrippedRewards
.
Prior to calling this function, the user must have approved CozyRouter
to a spend sufficient amount of their RewardPool.depositReceiptToken
balance.
Instead of specifying a depositReceiptTokenAmount_
to redeem, the user can also specify an rewardAssetAmount_
to withdraw and call CozyRouter.withdrawRewardPoolAssets
.
Previewing a redemption
RewardsManager.previewUndrippedRewardsRedemption
returns the amount of reward assets to be returned on a redemption.
Redemption mechanics
RewardsManager.redeemUndrippedRewards
takes the following steps:
Check it the Rewards Manager is
ACTIVE
. If so, drip any pending rewards.Compute the relevant amount of undripped rewards to be returned.
Burn the
owner_
's deposit receipt tokens.Update the
RewardPool.undrippedRewards
value.Transfer the returned undripped rewards to the
receiver_
address.Emit a
RedeemedUndrippedRewards
event.
Last updated