Multiple Rewards and Claim
In Aave Protocol V2, Aave Governance activated liquidity mining rewards through a community proposal. While emissions of rewards differ per asset, the rewards were all denominated in
stkAave
tokens. Aave Protocol V3 offers option to have multiple rewards per token. Now, it is possible for an asset listing to enable additional incentive rewards denominated in their protocol tokens.V3 also allows user to claim rewards to another account as well as self and to claim multiple types of rewards per asset in single tx.
The RewardsController contract is the main contract where the user interacts to claim the rewards of their positions. The users can claim all the rewards or an individual reward per transaction, with a variety of functions that allow more granularity at claim.
User(s) should already have a position in the protocol. Depending on the market and incentives that are enabled, they should already have a supply, borrow or both in one of the incentivised assets.
To get list of rewards available for the given asset, use the
getRewardsByAsset()
method, passing in the associated a/s/vToken address of the incentivised asset. Use getRewardsData()
to get details per reward per asset.const aDaiRewardsList = await rewardsController.getRewardsByAsset(aDaiAddress);
const aDaiRewardOneData = await rewardsController.getRewardsData(
aDaiAddress,
rewardOneAddress
);
You can get user reward balance for a given reward token or all reward tokens for a given list of assets using
getUserRewardsBalance()
or getAllUserRewardsBalance()
respectively.const unclaimedUserRewards = await rewardsController.getUserRewardsBalance(
[aDai.address, aWeth.address],
userAddress,
stkAave.address
);
const [, allUnclaimedRewards] = await rewardsController.getAllUserRewardsBalance(
[aDai.address, aWeth.address],
userAddress
);
Claim one or all type of rewards to self, another address or onBehalf of an address (only authorised claimers) for a given assets list.
User can claim one or all type of rewards using
claimRewardsToSelf()
and claimAllRewardsToSelf()
respectively for the list of assets passed to the method.The
msg.sender
must match the user's address that has accrued the rewards.// claims only stkAave for asset list [aDai, aWETH, ]
const claimStkAave = await rewardsController.claimRewardsToSelf(
[aDai.address, aWETH.address, ],
amountToClaim,
stkAave.address
);
// claims all reward types for asset list [aDai, aWETH, ]
const claimAllRewards = await rewardsController.claimAllRewardsToSelf(
[aDai.address, aWeth.address, ]
);
Authorised user/contract addresses can claim one or all type of rewards onBehalfOf, the user accruing rewards, using
claimRewardsOnBehalf()
and claimAllRewardsOnBehalf()
respectively for the list of assets passed to the method.The
msg.sender
must be an authorised claimer set using setClaimer() method, via Governance Vote.// claims only stkAave for asset list [aDai, aWETH, ]
const claimStkAaveOnBehalfOf = await rewardsController.claimRewardsOnBehalf(
[aDai.address],
MAX_UINT_AMOUNT,
userWithRewards.address,
claimer.address,
stkAave.address
)