Incentives
Last updated
Was this helpful?
Last updated
Was this helpful?
The provides methods to query all active incentive emissions, and claimable user incentives for a particular Nexus market.
RewardsController is the main rewards contract where the user interacts to claim the rewards of their positions. It is an abstract contract template to build Distributors contracts for ERC20 rewards to protocol participants. RewardsController inherits from RewardsDistributor to handle the distribution of rewards. The users of the incentivized ERC20 assets will accrue value if they hold their tokens in possession without the need for staking or blocking the assets inside a contract.
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.
Initialize RewardsController instance.
Input Parameters:
address
Unused but required due to being initialized by PoolAddressProvider._updateImpl()
Configure assets to incentivize with an emission of rewards per second until the end of distribution.
Input Parameters:
config
RewardsDataTypes.RewardsConfigInput[]
The emission per second following rewards unit decimals
The RewardsDataTypes.RewardsConfigInput struct is composed of the following fields:
emissionPerSecond
uint88
The emission per second following rewards unit decimals
totalSupply
uint256
The total supply of the asset to incentivize
distributionEnd
uint32
The end of the distribution of the incentives for an asset
asset
address
The asset address to incentivize
reward
address
The reward token address
transferStrategy
ITransferStrategy
The TransferStrategy address with the install hook and claim logic
rewardOracle
IEACAggregatorProxy
The Price Oracle of a reward to visualize the incentives at the UI frontend. Must follow Chainlink Aggregator IEACAggregatorProxy interface to be compatible.
Sets a TransferStrategy logic contract that determines the logic of the rewards transfer.
Input Parameters:
reward
address
The address of the reward token
transferStrategy
address
The address of the TransferStrategy logic contract
Sets a Nexus 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 is compatible with IEACAggregator proxy. This check is enforced for integrators to show incentives at the current Nexus UI without needing to set up an external price registry.
Input Parameters:
reward
address
The address of the reward to set the price aggregator
rewardOracle
IEACAggregatorProxy
The address of price aggregator that follows the IEACAggregatorProxy interface
Called by the corresponding asset on transfer hook to update the rewards distribution of a user.
Input Parameters:
user
address
The address of the user
totalSupply
uint256
The user balance of the asset
userBalance
uint256
The total supply of the asset
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:
assets
address[]
The list of assets to check eligible distributions before claiming rewards. Pass a/s/vToken addresses
amount
uint256
The amount of rewards to claim, expressed in wei. Pass MAX_UINT to claim the entire unclaimed reward balance
to
address
The address that will be receiving the rewards
reward
address
The address of the reward token (e.g., ZBU)
Return Values:
uint256
The amount of rewards claimed for one specific reward
The msg.sender must be an authorized claimer set using the setClaimer() method, via a Governance Vote.
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 whitelisted via the allowClaimOnBehalf function by the EmissionManager role held by Nexus Governance. Rewards are received by the to address.
Input Parameters:
assets
address[]
The list of assets to check eligible distributions before claiming rewards. Pass a/s/vToken addresses
amount
uint256
The amount of rewards to claim, expressed in wei. Pass MAX_UINT to claim the entire unclaimed reward balance
user
address
The address to check and claim rewards
to
address
The address that will be receiving the rewards
reward
address
The address of the reward token being claimed (e.g., ZBU)
Return Values:
uint256
The amount of rewards claimed
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:
assets
address[]
The list of assets to check eligible distributions before claiming rewards. Pass a/s/vToken addresses
amount
uint256
The amount of rewards to claim, expressed in wei. Pass MAX_UINT to claim the entire unclaimed reward balance
reward
address
The address of the reward token
Return Values:
uint256
The amount of rewards claimed for one specific reward
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:
assets
address[]
The list of assets to check eligible distributions before claiming rewards (zToken or variableDebtToken addresses)
to
address
The address that will be receiving the rewards
Return Values:
rewardsList
address[]
The list of addresses of the reward tokens
claimedAmounts
uint256[]
The list that contains the claimed amount per reward, following the same order as rewardsList
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 whitelisted via the allowClaimOnBehalf function by the EmissionManager role held by Nexus Governance. Rewards are received by the to address.
Input Parameters:
assets
address[]
The list of assets to check eligible distributions before claiming rewards. Pass a/s/vToken addresses
user
address
The address to check and claim rewards
to
address
The address that will be receiving the rewards
Return Values:
rewardsList
address[]
The list of addresses of the reward tokens
claimedAmounts
uint256[]
The list that contains the claimed amount per reward, following the same order as rewardsList
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:
assets
address[]
The list of assets to check eligible distributions before claiming rewards. Pass a/s/vToken addresses
Return Values:
rewardsList
address[]
The list of addresses of the reward tokens
claimedAmounts
uint256[]
The list that contains the claimed amount per reward, following the same order as rewardsList
Whitelists an address to claim rewards on behalf of another address. Can only be called by the EmissionManager.
Input Parameters:
user
address
The address of the user
caller
address
The address of the claimer
Returns the whitelisted claimer for a certain address. It returns the 0x0 address if it is not set.
Input Parameters:
user
address
The address of the user
Return Values:
address
The claimer address
Get the price aggregator oracle address.
reward
address
The address of the reward token
Return Values:
address
The address of the reward oracle
Returns the Transfer Strategy implementation contract address being used for a reward address.
reward
address
The address of the reward
Return Values:
address
The address of the TransferStrategy contract
Returns the revision of the implementation contract.
Return Values:
uint256
The current revision version