Skip to Content
docs

Aave V3 Incentives Contracts

The UiIncentiveDataProvider provides methods to query all active incentive emissions, and claimable user incentives for a particular Aave market.

RewardsController

RewardsController is the main rewards contract, where users claim the ERC-20 rewards of their positions. It inherits from the abstract RewardsDistributor, which handles reward distribution. Holders of incentivized ERC-20 assets accrue rewards just by holding them, with no staking or locking.

The users can claim all the rewards or an individual reward per transaction, with a variety of functions that allow more granularity at claim.

At every transfer, the asset must call the handleAction method to account for the user’s rewards.

The source code is available on GitHub.

Write Methods

initialize

Solidity
function initialize(address) external initializer

Initialize RewardsController instance.

Input Parameters:

TypeDescription
addressUnused but required due to being initialized by PoolAddressesProvider._updateImpl()

configureAssets

Solidity
function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external override onlyEmissionManager

Configure assets to incentivize with an emission of rewards per second until the end of distribution.

Input Parameters:

NameTypeDescription
configRewardsDataTypes.RewardsConfigInput[]The array of reward configurations, one per asset/reward pair

The RewardsDataTypes.RewardsConfigInput struct is composed of the following fields:

NameTypeDescription
emissionPerSeconduint88The emission per second following rewards unit decimals
totalSupplyuint256The total supply of the asset to incentivize
distributionEnduint32The end of the distribution of the incentives for an asset
assetaddressThe asset address to incentivize
rewardaddressThe reward token address
transferStrategyITransferStrategyBaseThe TransferStrategy address with the install hook and claim logic
rewardOracleAggregatorInterfaceThe Price Oracle of a reward to visualize the incentives at the UI frontend. Must follow the Chainlink AggregatorInterface and return a positive latestAnswer().

setTransferStrategy

Solidity
function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external onlyEmissionManager

Sets a TransferStrategy logic contract that determines the logic of the rewards transfer.

Input Parameters:

NameTypeDescription
rewardaddressThe address of the reward token
transferStrategyITransferStrategyBaseThe address of the TransferStrategy logic contract

setRewardOracle

Solidity
function setRewardOracle(address reward, AggregatorInterface rewardOracle) external onlyEmissionManager

Sets an Aave Oracle contract to enforce rewards with a source of value.

At the moment of reward configuration, the Incentives Controller performs a check to see if the reward asset oracle follows the Chainlink AggregatorInterface and returns a positive latestAnswer(). This check is enforced for integrators to show incentives at the current Aave UI without needing to set up an external price registry.

Input Parameters:

NameTypeDescription
rewardaddressThe address of the reward to set the price aggregator
rewardOracleAggregatorInterfaceThe address of price aggregator that follows the Chainlink AggregatorInterface and returns a positive latestAnswer()

handleAction

Solidity
function handleAction(address user, uint256 totalSupply, uint256 userBalance) external override

Called by the corresponding asset on transfer hook to update the rewards distribution of a user.

Input Parameters:

NameTypeDescription
useraddressThe address of the user
totalSupplyuint256The total supply of the asset before the balance change
userBalanceuint256The user balance of the asset before the balance change

claimRewards

Solidity
function claimRewards(
    address[] calldata assets,
    uint256 amount,
    address to,
    address reward
) external override returns (uint256)

Claims reward for a user to the desired address, on all the assets of the pool, accumulating the pending rewards. Rewards are received by the to address.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)
amountuint256The amount of rewards to claim, expressed in wei. Pass type(uint256).max to claim the entire unclaimed reward balance
toaddressThe address that will be receiving the rewards
rewardaddressThe address of the reward token (e.g., stkAAVE)

Return Values:

TypeDescription
uint256The amount of rewards claimed for one specific reward

claimRewardsOnBehalf

Solidity
function claimRewardsOnBehalf(
    address[] calldata assets,
    uint256 amount,
    address user,
    address to,
    address reward
) external override onlyAuthorizedClaimers(msg.sender, user) returns (uint256)

Claims rewards for a user on behalf, on all the assets of the pool, accumulating the pending rewards of the assets passed by the first argument. The caller must be set as claimer for user via setClaimer() by the EmissionManager. Rewards are received by the to address.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)
amountuint256The amount of rewards to claim, expressed in wei. Pass type(uint256).max to claim the entire unclaimed reward balance
useraddressThe address to check and claim rewards
toaddressThe address that will be receiving the rewards
rewardaddressThe address of the reward token being claimed (e.g., stkAAVE)

Return Values:

TypeDescription
uint256The amount of rewards claimed

claimRewardsToSelf

Solidity
function claimRewardsToSelf(address[] calldata assets, uint256 amount, address reward) external override returns (uint256)

Claims reward for msg.sender, on all the assets of the pool, accumulating the pending rewards passed by the first input parameter. Rewards are received by msg.sender.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)
amountuint256The amount of rewards to claim, expressed in wei. Pass type(uint256).max to claim the entire unclaimed reward balance
rewardaddressThe address of the reward token

Return Values:

TypeDescription
uint256The amount of rewards claimed for one specific reward

claimAllRewards

Solidity
function claimAllRewards(address[] calldata assets, address to) external override returns (address[] memory rewardsList, uint256[] memory claimedAmounts)

Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards passed by the first input parameter. Rewards are received by the to address.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)
toaddressThe address that will be receiving the rewards

Return Values:

NameTypeDescription
rewardsListaddress[]The list of addresses of the reward tokens
claimedAmountsuint256[]The list that contains the claimed amount per reward, following the same order as rewardsList

claimAllRewardsOnBehalf

Solidity
function claimAllRewardsOnBehalf(
    address[] calldata assets,
    address user,
    address to
) external override onlyAuthorizedClaimers(msg.sender, user) returns (address[] memory rewardsList, uint256[] memory claimedAmounts)

Claims all rewards for a user on behalf, on all the assets of the pool, accumulating the pending rewards passed by the first input parameter. The caller must be set as claimer for user via setClaimer() by the EmissionManager. Rewards are received by the to address.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)
useraddressThe address to check and claim rewards
toaddressThe address that will be receiving the rewards

Return Values:

NameTypeDescription
rewardsListaddress[]The list of addresses of the reward tokens
claimedAmountsuint256[]The list that contains the claimed amount per reward, following the same order as rewardsList

claimAllRewardsToSelf

Solidity
function claimAllRewardsToSelf(address[] calldata assets) external override returns (address[] memory rewardsList, uint256[] memory claimedAmounts)

Claims all rewards accrued by msg.sender, on all assets of the pool, accumulating the pending rewards by the first input parameter. Rewards are received by msg.sender.

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets to check eligible distributions before claiming rewards (aToken or variableDebtToken addresses)

Return Values:

NameTypeDescription
rewardsListaddress[]The list of addresses of the reward tokens
claimedAmountsuint256[]The list that contains the claimed amount per reward, following the same order as rewardsList

setClaimer

Solidity
function setClaimer(address user, address caller) external override onlyEmissionManager

Whitelists an address to claim rewards on behalf of another address. Can only be called by the EmissionManager.

Input Parameters:

NameTypeDescription
useraddressThe address of the user
calleraddressThe address of the claimer

View Methods

getClaimer

Solidity
function getClaimer(address user) external view override returns (address)

Returns the whitelisted claimer for a certain address. It returns the 0x0 address if it is not set.

Input Parameters:

NameTypeDescription
useraddressThe address of the user

Return Values:

TypeDescription
addressThe claimer address

getRewardOracle

Solidity
function getRewardOracle(address reward) external view override returns (address)

Get the price aggregator oracle address.

Input Parameters:

NameTypeDescription
rewardaddressThe address of the reward token

Return Values:

TypeDescription
addressThe address of the reward oracle

getTransferStrategy

Solidity
function getTransferStrategy(address reward) external view override returns (address)

Returns the Transfer Strategy implementation contract address being used for a reward address.

Input Parameters:

NameTypeDescription
rewardaddressThe address of the reward

Return Values:

TypeDescription
addressThe address of the TransferStrategy contract