Multiple Rewards and Claim

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.

Integration Guide

Prerequisites

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.

Check rewards enabled

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.
1
const aDaiRewardsList = await rewardsController.getRewardsByAsset(aDaiAddress);
2
3
const aDaiRewardOneData = await rewardsController.getRewardsData(
4
aDaiAddress,
5
rewardOneAddress
6
);
Copied!

Check User(s) reward balance

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.
1
const unclaimedUserRewards = await rewardsController.getUserRewardsBalance(
2
[aDai.address, aWeth.addresss],
3
userAddress,
4
stkAave.address
5
);
6
7
const [, allUnclaimedRewards] = await rewardsController.getAllUserRewardsBalance(
8
[aDai.address, aWeth.address],
9
userAddress
10
);
Copied!

Claim Rewards

Claim one or all type of rewards to self, another address or onBehalf of an address (only authorised claimers) for a given assets list.

Self

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.
1
// claims only stkAave for asset list [aDai, aWETH, ]
2
const claimStkAave = await rewardsController.claimRewardsToSelf(
3
[aDai.address, aWETH.address, ],
4
amountToClaim,
5
stkAave.address
6
);
7
8
// claims all reward types for asset list [aDai, aWETH, ]
9
const claimAllRewards = await rewardsController.claimAllRewardsToSelf(
10
[aDai.address, aWeth.address, ]
11
);
Copied!

onBehalfOf An 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.
1
// claims only stkAave for asset list [aDai, aWETH, ]
2
const claimStkAaveOnBehalfOf = await rewardsController.claimRewardsOnBehalf(
3
[aDai.address],
4
MAX_UINT_AMOUNT,
5
userWithRewards.address,
6
claimer.address,
7
stkAave.address
8
)
9
10
// claims all reward types for asset list [aDai, aWETH, ]
11
const claimAllRewardsOnBehalfOf = await rewardsController.claimAllRewardsOnBehalf(
12
[aDai.address],
13
userWithRewards.address,
14
claimer.address
15
)
Copied!

To Another Address

User can claim one or all type of rewards, to an external account (i.e. an account which may or may not be accruing the rewards being claimed), using claimRewards() and claimAllRewards() respectively for the list of assets passed to the method.
The msg.sender must match the user's address that has accrued the rewards
1
// claims only stkAave for asset list [aDai, aWETH, ] to receivingAccunt
2
const claimStkAave = await rewardsController.claimRewards(
3
[aDai.address, aWETH.address, ],
4
amountToClaim,
5
receivingAccount.address
6
stkAave.address
7
);
8
9
// claims all reward types for asset list [aDai, aWETH, ] to receivingAccunt
10
const claimAllRewards = await rewardsController.claimAllRewards(
11
[aDai.address, aWeth.address, ],
12
receivingAccount.address
13
);
Copied!