Mangrove
Developper
Developper
  • Welcome
  • Protocol
    • Introduction
    • Technical References
      • Overview
      • Ticks, ratios, and prices
      • Offer-list
        • Views on offers
      • Market-order
        • Delegation
      • Creating & Updating offers
        • Maker contract
        • Offer provisions
        • Gas requirement
        • Public data structures
        • Executing offers
      • Cleaning offers
      • Governance-parameters
        • Global variables
        • Local variables
        • Data structures and views
      • Periphery Contracts
        • MgvReader
        • MgvOracle
      • Literate Source Code
    • Background
      • Taking available liquidity
      • Making liquidity available
      • Reneging on offers
  • Strat Lib
    • What is the Strat Library?
    • Getting-started
      • Set Up Your Local Environment
      • Post a Smart Offer
    • Guides
      • Unlocking liquidity
      • Reposting an offer in the posthook
      • Using last look to renege trades
      • Determining gas requirements
      • Creating a Direct contract
      • Deploying your contract
      • Testing a maker contract
      • Safe offer logic guidelines
      • Approvals
    • Technical references
      • Principal hooks
      • Liquidity routing
      • API preferences
        • Core
          • SRC
            • IMangrove
        • Strats
          • SRC
            • Strategies
              • MangroveOffer
              • MangroveOrder
              • Integrations
                • AaveV3Borrower
                • AaveV3BorrowerImplementation
                • AaveV3BorrowerStorage
                • AaveV3Lender
                • CompoundModule
              • Interfaces
                • IForwarder
                • ILiquidityProvider
                • IOfferLogic
                • IOrderLogic
              • Offer_forwarder
                • Abstract
                  • Forwarder
              • Offer_maker
                • Abstract
                  • Direct
                • Market_making
                  • Kandel
                    • AaveKandel
                    • AaveKandelSeeder
                    • KandelSeeder
                    • Abstract
                      • AbstractKandelSeeder
                      • CoreKandel
                      • DirectWithBidsAndAsksDistribution
                      • GeometricKandel
                      • HasIndexedBidsAndAsks
                      • KandelLib
                      • TradesBaseQuotePair
              • Routeurs
                • SimpleRouter
                • Abstract
                  • AbstractRouter
                • Integrations
                  • AavePooledRouter
                  • HasAaveBalanceMemoizer
              • Utils
                • AccessControlled
              • Vendor
                • AAVE
                  • V3
                    • Contracts
                      • Dependencies
                        • Oppenzeppelin
                          • Contracts
                            • IERC20
                      • Interfaces
                        • IAToken
                        • IAaveIncentivesController
                        • IAaveOracle
                        • ICreditDelegationToken
                        • IInitializableAToken
                        • IPool
                        • IPoolAddressesProvider
                        • IPriceOracleGetter
                        • IScaledBalanceToken
                      • Protocol
                        • Libraries
                          • Configurations
                            • ReserveConfiguration
                          • Helpers
                            • Errors
                          • Types
                            • DataTypes
                    • Periphery
                      • Contracts
                        • MISC
                          • Interfaces
                            • IEACAggregatorProxy
                        • Rewards
                          • Interfaces
                            • IRewardsController
                            • IRewardsDistributor
                            • ITransferStrategyBase
                          • Libraries
                            • RewardsDataTypes
                • Compound
                  • CarefulMath
                  • Exponential
                  • ExponentialNoError
                  • ICompound
    • Background
      • Building Blocks
        • MangroveOffer
        • Direct
        • Forwarder
  • Vaults
    • Understanding vaults
      • Oracles
    • Managing a vault (CLI)
      • Deploying an oracle
      • Creating a vault
      • Monitoring the vault
      • Setting the vault position
      • Setting the fee data
      • Rebalancing
      • Adding or removing liquidity
    • Custom interactions
      • Oracles
      • Vault Factory
      • Managing a vault
        • Setting the position
        • Rebalancing
        • Setting a manager
        • Setting fee
  • Keeper Bots
    • Keeper Bots
    • Guides
      • Using borrowed funds for cleaning
    • Backgroud
      • The role of cleaning bots in Mangrove
      • The role of gas price updater bots in Mangrove
  • Adresses
    • Deployment Addresses
  • Quick Links
    • Glossary
    • Website
    • Whitepaper
Powered by GitBook
On this page
  • ClaimerSet
  • Parameters
  • RewardsClaimed
  • Parameters
  • TransferStrategyInstalled
  • Parameters
  • RewardOracleUpdated
  • Parameters
  • setClaimer
  • Parameters
  • setTransferStrategy
  • Parameters
  • setRewardOracle
  • Parameters
  • getRewardOracle
  • Parameters
  • Return Values
  • getClaimer
  • Parameters
  • Return Values
  • getTransferStrategy
  • Parameters
  • Return Values
  • configureAssets
  • Parameters
  • handleAction
  • Parameters
  • claimRewards
  • Parameters
  • Return Values
  • claimRewardsOnBehalf
  • Parameters
  • Return Values
  • claimRewardsToSelf
  • Parameters
  • Return Values
  • claimAllRewards
  • Parameters
  • Return Values
  • claimAllRewardsOnBehalf
  • Parameters
  • Return Values
  • claimAllRewardsToSelf
  • Parameters
  • Return Values
  1. Strat Lib
  2. Technical references
  3. API preferences
  4. Strats
  5. SRC
  6. Strategies
  7. Vendor
  8. AAVE
  9. V3
  10. Periphery
  11. Contracts
  12. Rewards
  13. Interfaces

IRewardsController

Defines the basic interface for a Rewards Controller.

ClaimerSet

event ClaimerSet(address user, address claimer)

Emitted when a new address is whitelisted as claimer of rewards on behalf of a user

Parameters

Name
Type
Description

user

address

The address of the user

claimer

address

The address of the claimer

RewardsClaimed

event RewardsClaimed(address user, address reward, address to, address claimer, uint256 amount)

Emitted when rewards are claimed

Parameters

Name
Type
Description

user

address

The address of the user rewards has been claimed on behalf of

reward

address

The address of the token reward is claimed

to

address

The address of the receiver of the rewards

claimer

address

The address of the claimer

amount

uint256

The amount of rewards claimed

TransferStrategyInstalled

event TransferStrategyInstalled(address reward, address transferStrategy)

Emitted when a transfer strategy is installed for the reward distribution

Parameters

Name
Type
Description

reward

address

The address of the token reward

transferStrategy

address

The address of TransferStrategy contract

RewardOracleUpdated

event RewardOracleUpdated(address reward, address rewardOracle)

Emitted when the reward oracle is updated

Parameters

Name
Type
Description

reward

address

The address of the token reward

rewardOracle

address

The address of oracle

setClaimer

function setClaimer(address user, address claimer) external

Whitelists an address to claim the rewards on behalf of another address

Parameters

Name
Type
Description

user

address

The address of the user

claimer

address

The address of the claimer

setTransferStrategy

function setTransferStrategy(address reward, contract ITransferStrategyBase transferStrategy) external

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

Parameters

Name
Type
Description

reward

address

The address of the reward token

transferStrategy

contract ITransferStrategyBase

The address of the TransferStrategy logic contract

setRewardOracle

function setRewardOracle(address reward, contract IEACAggregatorProxy rewardOracle) external

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 be able to show incentives at the current Aave UI without the need to setup an external price registry

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

Parameters

Name
Type
Description

reward

address

The address of the reward to set the price aggregator

rewardOracle

contract IEACAggregatorProxy

The address of price aggregator that follows IEACAggregatorProxy interface

getRewardOracle

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

Get the price aggregator oracle address

Parameters

Name
Type
Description

reward

address

The address of the reward

Return Values

Name
Type
Description

[0]

address

The price oracle of the reward

getClaimer

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

Returns the whitelisted claimer for a certain address (0x0 if not set)

Parameters

Name
Type
Description

user

address

The address of the user

Return Values

Name
Type
Description

[0]

address

The claimer address

getTransferStrategy

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

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

Parameters

Name
Type
Description

reward

address

The address of the reward

Return Values

Name
Type
Description

[0]

address

The address of the TransferStrategy contract

configureAssets

function configureAssets(struct RewardsDataTypes.RewardsConfigInput[] config) external

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

Parameters

Name
Type
Description

config

struct RewardsDataTypes.RewardsConfigInput[]

The assets configuration input, the list of structs contains the following fields: uint104 emissionPerSecond: The emission per second following rewards unit decimals. uint256 totalSupply: The total supply of the asset to incentivize uint40 distributionEnd: The end of the distribution of the incentives for an asset address asset: The asset address to incentivize address reward: The reward token address ITransferStrategy transferStrategy: The TransferStrategy address with the install hook and claim logic. IEACAggregatorProxy rewardOracle: The Price Oracle of a reward to visualize the incentives at the UI Frontend. Must follow Chainlink Aggregator IEACAggregatorProxy interface to be compatible.

handleAction

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

Called by the corresponding asset on transfer hook in order to update the rewards distribution. The units of totalSupply and userBalance should be the same.

Parameters

Name
Type
Description

user

address

The address of the user whose asset balance has changed

totalSupply

uint256

The total supply of the asset prior to user balance change

userBalance

uint256

The previous user balance prior to balance change

claimRewards

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

Claims reward for a user to the desired address, on all the assets of the pool, accumulating the pending rewards

Parameters

Name
Type
Description

assets

address[]

List of assets to check eligible distributions before claiming rewards

amount

uint256

The amount of rewards to claim

to

address

The address that will be receiving the rewards

reward

address

The address of the reward token

Return Values

Name
Type
Description

[0]

uint256

The amount of rewards claimed

claimRewardsOnBehalf

function claimRewardsOnBehalf(address[] assets, uint256 amount, address user, address to, address reward) external returns (uint256)

Claims reward for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The caller must be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager

Parameters

Name
Type
Description

assets

address[]

The list of assets to check eligible distributions before claiming rewards

amount

uint256

The amount of rewards to claim

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

Return Values

Name
Type
Description

[0]

uint256

The amount of rewards claimed

claimRewardsToSelf

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

Claims reward for msg.sender, on all the assets of the pool, accumulating the pending rewards

Parameters

Name
Type
Description

assets

address[]

The list of assets to check eligible distributions before claiming rewards

amount

uint256

The amount of rewards to claim

reward

address

The address of the reward token

Return Values

Name
Type
Description

[0]

uint256

The amount of rewards claimed

claimAllRewards

function claimAllRewards(address[] assets, address to) external returns (address[] rewardsList, uint256[] claimedAmounts)

Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards

Parameters

Name
Type
Description

assets

address[]

The list of assets to check eligible distributions before claiming rewards

to

address

The address that will be receiving the rewards

Return Values

Name
Type
Description

rewardsList

address[]

List of addresses of the reward tokens

claimedAmounts

uint256[]

List that contains the claimed amount per reward, following same order as "rewardList"

claimAllRewardsOnBehalf

function claimAllRewardsOnBehalf(address[] assets, address user, address to) external returns (address[] rewardsList, uint256[] claimedAmounts)

Claims all rewards for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The caller must be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager

Parameters

Name
Type
Description

assets

address[]

The list of assets to check eligible distributions before claiming rewards

user

address

The address to check and claim rewards

to

address

The address that will be receiving the rewards

Return Values

Name
Type
Description

rewardsList

address[]

List of addresses of the reward tokens

claimedAmounts

uint256[]

List that contains the claimed amount per reward, following same order as "rewardsList"

claimAllRewardsToSelf

function claimAllRewardsToSelf(address[] assets) external returns (address[] rewardsList, uint256[] claimedAmounts)

Claims all reward for msg.sender, on all the assets of the pool, accumulating the pending rewards

Parameters

Name
Type
Description

assets

address[]

The list of assets to check eligible distributions before claiming rewards

Return Values

Name
Type
Description

rewardsList

address[]

List of addresses of the reward tokens

claimedAmounts

uint256[]

List that contains the claimed amount per reward, following same order as "rewardsList"

PreviousInterfacesNextIRewardsDistributor