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
  • POOL
  • ADDRESS_PROVIDER
  • constructor
  • Parameters
  • _approveLender
  • Parameters
  • _exitMarket
  • Parameters
  • _enterMarkets
  • Parameters
  • overlying
  • Parameters
  • Return Values
  • _redeem
  • Parameters
  • Return Values
  • _supply
  • Parameters
  • Return Values
  • _claimRewards
  • Parameters
  • Return Values
  • checkAsset
  • Parameters
  • Return Values
  1. Strat Lib
  2. Technical references
  3. API preferences
  4. Strats
  5. SRC
  6. Strategies
  7. Integrations

AaveV3Lender

POOL

contract IPool POOL

The AAVE pool retrieved from the pool provider.

ADDRESS_PROVIDER

contract IPoolAddressesProvider ADDRESS_PROVIDER

The AAVE pool address provider.

constructor

constructor(address addressesProvider) public

contract's constructor

Parameters

Name
Type
Description

addressesProvider

address

address of AAVE's address provider

_approveLender

function _approveLender(contract IERC20 token, uint256 amount) internal

allows this contract to approve the POOL to transfer some underlying asset on its behalf

this is a necessary step prior to supplying tokens to the POOL or to repay a debt

Parameters

Name
Type
Description

token

contract IERC20

the underlying asset for which approval is required

amount

uint256

the approval amount

_exitMarket

function _exitMarket(contract IERC20 underlying) internal

prevents the POOL from using some underlying as collateral

this call will revert if removing the asset from collateral would put the account into a liquidation state

Parameters

Name
Type
Description

underlying

contract IERC20

the token one wishes to remove collateral

_enterMarkets

function _enterMarkets(contract IERC20[] underlyings) internal

allows the POOL to use some underlying tokens as collateral

when supplying a token for the first time, it is automatically set as possible collateral so there is no need to call this function for it.

Parameters

Name
Type
Description

underlyings

contract IERC20[]

the token one wishes to add as collateral

overlying

function overlying(contract IERC20 asset) public view returns (contract IERC20 aToken)

convenience function to obtain the overlying of a given asset

Parameters

Name
Type
Description

asset

contract IERC20

the underlying asset

Return Values

Name
Type
Description

aToken

contract IERC20

the overlying asset

_redeem

function _redeem(contract IERC20 token, uint256 amount, address to) internal returns (uint256 redeemed)

redeems funds from the pool

Parameters

Name
Type
Description

token

contract IERC20

the asset one is trying to redeem

amount

uint256

of assets one wishes to redeem

to

address

is the address where the redeemed assets should be transferred

Return Values

Name
Type
Description

redeemed

uint256

the amount of asset that were transferred to to

_supply

function _supply(contract IERC20 token, uint256 amount, address onBehalf, bool noRevert) internal returns (bytes32)

supplies funds to the pool

Parameters

Name
Type
Description

token

contract IERC20

the asset one is supplying

amount

uint256

of assets to be transferred to the pool

onBehalf

address

address of the account whose collateral is being supplied to and which will receive the overlying

noRevert

bool

does not revert if supplies throws

Return Values

Name
Type
Description

[0]

bytes32

reason for revert from Aave.

_claimRewards

function _claimRewards(address[] assets, address to) internal returns (address[] rewardsList, uint256[] claimedAmounts)

rewards claiming.

Parameters

Name
Type
Description

assets

address[]

list of overlying for which one is claiming awards

to

address

whom the rewards should be sent

Return Values

Name
Type
Description

rewardsList

address[]

the address of assets that have been claimed

claimedAmounts

uint256[]

the amount of assets that have been claimed

checkAsset

function checkAsset(contract IERC20 asset) public view returns (bool)

verifies whether an asset can be supplied on pool

Parameters

Name
Type
Description

asset

contract IERC20

the asset one wants to lend

Return Values

Name
Type
Description

[0]

bool

true if the asset can be supplied on pool

PreviousAaveV3BorrowerStorageNextCompoundModule