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
  • AssetConfigUpdated
  • Parameters
  • Accrued
  • Parameters
  • setDistributionEnd
  • Parameters
  • setEmissionPerSecond
  • Parameters
  • getDistributionEnd
  • Parameters
  • Return Values
  • getUserAssetIndex
  • Parameters
  • Return Values
  • getRewardsData
  • Parameters
  • Return Values
  • getAssetIndex
  • Parameters
  • Return Values
  • getRewardsByAsset
  • Parameters
  • Return Values
  • getRewardsList
  • Return Values
  • getUserAccruedRewards
  • Parameters
  • Return Values
  • getUserRewards
  • Parameters
  • Return Values
  • getAllUserRewards
  • Parameters
  • Return Values
  • getAssetDecimals
  • Parameters
  • Return Values
  • EMISSION_MANAGER
  • Return Values
  • getEmissionManager
  • 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

IRewardsDistributor

Defines the basic interface for a Rewards Distributor.

AssetConfigUpdated

event AssetConfigUpdated(address asset, address reward, uint256 oldEmission, uint256 newEmission, uint256 oldDistributionEnd, uint256 newDistributionEnd, uint256 assetIndex)

Emitted when the configuration of the rewards of an asset is updated.

Parameters

Name
Type
Description

asset

address

The address of the incentivized asset

reward

address

The address of the reward token

oldEmission

uint256

The old emissions per second value of the reward distribution

newEmission

uint256

The new emissions per second value of the reward distribution

oldDistributionEnd

uint256

The old end timestamp of the reward distribution

newDistributionEnd

uint256

The new end timestamp of the reward distribution

assetIndex

uint256

The index of the asset distribution

Accrued

event Accrued(address asset, address reward, address user, uint256 assetIndex, uint256 userIndex, uint256 rewardsAccrued)

Emitted when rewards of an asset are accrued on behalf of a user.

Parameters

Name
Type
Description

asset

address

The address of the incentivized asset

reward

address

The address of the reward token

user

address

The address of the user that rewards are accrued on behalf of

assetIndex

uint256

The index of the asset distribution

userIndex

uint256

The index of the asset distribution on behalf of the user

rewardsAccrued

uint256

The amount of rewards accrued

setDistributionEnd

function setDistributionEnd(address asset, address reward, uint32 newDistributionEnd) external

Sets the end date for the distribution

Parameters

Name
Type
Description

asset

address

The asset to incentivize

reward

address

The reward token that incentives the asset

newDistributionEnd

uint32

The end date of the incentivization, in unix time format

setEmissionPerSecond

function setEmissionPerSecond(address asset, address[] rewards, uint88[] newEmissionsPerSecond) external

Sets the emission per second of a set of reward distributions

Parameters

Name
Type
Description

asset

address

The asset is being incentivized

rewards

address[]

List of reward addresses are being distributed

newEmissionsPerSecond

uint88[]

List of new reward emissions per second

getDistributionEnd

function getDistributionEnd(address asset, address reward) external view returns (uint256)

Gets the end date for the distribution

Parameters

Name
Type
Description

asset

address

The incentivized asset

reward

address

The reward token of the incentivized asset

Return Values

Name
Type
Description

[0]

uint256

The timestamp with the end of the distribution, in unix time format

getUserAssetIndex

function getUserAssetIndex(address user, address asset, address reward) external view returns (uint256)

Returns the index of a user on a reward distribution

Parameters

Name
Type
Description

user

address

Address of the user

asset

address

The incentivized asset

reward

address

The reward token of the incentivized asset

Return Values

Name
Type
Description

[0]

uint256

The current user asset index, not including new distributions

getRewardsData

function getRewardsData(address asset, address reward) external view returns (uint256, uint256, uint256, uint256)

Returns the configuration of the distribution reward for a certain asset

Parameters

Name
Type
Description

asset

address

The incentivized asset

reward

address

The reward token of the incentivized asset

Return Values

Name
Type
Description

[0]

uint256

The index of the asset distribution

[1]

uint256

The emission per second of the reward distribution

[2]

uint256

The timestamp of the last update of the index

[3]

uint256

The timestamp of the distribution end

getAssetIndex

function getAssetIndex(address asset, address reward) external view returns (uint256, uint256)

Calculates the next value of an specific distribution index, with validations.

Parameters

Name
Type
Description

asset

address

The incentivized asset

reward

address

The reward token of the incentivized asset

Return Values

Name
Type
Description

[0]

uint256

The old index of the asset distribution

[1]

uint256

The new index of the asset distribution

getRewardsByAsset

function getRewardsByAsset(address asset) external view returns (address[])

Returns the list of available reward token addresses of an incentivized asset

Parameters

Name
Type
Description

asset

address

The incentivized asset

Return Values

Name
Type
Description

[0]

address[]

List of rewards addresses of the input asset

getRewardsList

function getRewardsList() external view returns (address[])

Returns the list of available reward addresses

Return Values

Name
Type
Description

[0]

address[]

List of rewards supported in this contract

getUserAccruedRewards

function getUserAccruedRewards(address user, address reward) external view returns (uint256)

Returns the accrued rewards balance of a user, not including virtually accrued rewards since last distribution.

Parameters

Name
Type
Description

user

address

The address of the user

reward

address

The address of the reward token

Return Values

Name
Type
Description

[0]

uint256

Unclaimed rewards, not including new distributions

getUserRewards

function getUserRewards(address[] assets, address user, address reward) external view returns (uint256)

Returns a single rewards balance of a user, including virtually accrued and unrealized claimable rewards.

Parameters

Name
Type
Description

assets

address[]

List of incentivized assets to check eligible distributions

user

address

The address of the user

reward

address

The address of the reward token

Return Values

Name
Type
Description

[0]

uint256

The rewards amount

getAllUserRewards

function getAllUserRewards(address[] assets, address user) external view returns (address[], uint256[])

Returns a list all rewards of a user, including already accrued and unrealized claimable rewards

Parameters

Name
Type
Description

assets

address[]

List of incentivized assets to check eligible distributions

user

address

The address of the user

Return Values

Name
Type
Description

[0]

address[]

The list of reward addresses

[1]

uint256[]

The list of unclaimed amount of rewards

getAssetDecimals

function getAssetDecimals(address asset) external view returns (uint8)

Returns the decimals of an asset to calculate the distribution delta

Parameters

Name
Type
Description

asset

address

The address to retrieve decimals

Return Values

Name
Type
Description

[0]

uint8

The decimals of an underlying asset

EMISSION_MANAGER

function EMISSION_MANAGER() external view returns (address)

Returns the address of the emission manager

Return Values

Name
Type
Description

[0]

address

The address of the EmissionManager

getEmissionManager

function getEmissionManager() external view returns (address)

Returns the address of the emission manager. Deprecated: This getter is maintained for compatibility purposes. Use the EMISSION_MANAGER() function instead.

Return Values

Name
Type
Description

[0]

address

The address of the EmissionManager

PreviousIRewardsControllerNextITransferStrategyBase