AaveV3Adapter
The implementation of Aave.Finance MoneyMarket that integrates with AssetManager.
assetManager
address assetManagerthe AssetManager contract address
market
contract AMarket3 marketAave Market contract
lendingPool
contract LendingPool3 lendingPoolAave Lending pool contract
tokenToAToken
mapping(address => address) tokenToATokenMapping of token to aToken
floorMap
mapping(address => uint256) floorMapMapping of token to floor amount
ceilingMap
mapping(address => uint256) ceilingMapMapping of token to ceiling amount
LogSetAssetManager
event LogSetAssetManager(address sender, address assetManager)LogSetFloor
event LogSetFloor(address sender, address tokenAddress, uint256 floor)LogSetCeiling
event LogSetCeiling(address sender, address tokenAddress, uint256 ceiling)__AaveV3Adapter_init
function __AaveV3Adapter_init(address _assetManager, contract LendingPool3 _lendingPool, contract AMarket3 _market) publicTokenNotSupported
error TokenNotSupported()SenderNotAssetManager
error SenderNotAssetManager()checkTokenSupported
modifier checkTokenSupported(address tokenAddress)Check supplied token address is supported
onlyAssetManager
modifier onlyAssetManager()Check sender is the asset manager
setAssetManager
function setAssetManager(address _assetManager) externalSet the asset manager contract address Only callable by the admin
Parameters
_assetManager
address
AssetManager contract address
setFloor
function setFloor(address tokenAddress, uint256 floor) externalSet floor amount Only callable by the admin
Parameters
tokenAddress
address
Address of the token to set the floor for
floor
uint256
Floor amount
setCeiling
function setCeiling(address tokenAddress, uint256 ceiling) externalSet ceiling amount Only callable by the admin
Parameters
tokenAddress
address
Address of the token to set the ceiling for
ceiling
uint256
ceiling amount
getRate
function getRate(address tokenAddress) external view returns (uint256)Get the underlying market rate
Parameters
tokenAddress
address
The underlying token address
getSupply
function getSupply(address tokenAddress) external view returns (uint256)Get total supply of this Contracts
Parameters
tokenAddress
address
The token to check supply for
getSupplyView
function getSupplyView(address tokenAddress) external view returns (uint256)Get total supply of this Contracts including any balance that has been deposited into the underlying market
Parameters
tokenAddress
address
The token to check supply for
supportsToken
function supportsToken(address tokenAddress) external view returns (bool)Check if this token is supported
Parameters
tokenAddress
address
The token to check
mapTokenToAToken
function mapTokenToAToken(address tokenAddress) externalAdd aToken to the token mapping for a supported token
Parameters
tokenAddress
address
Token address
deposit
function deposit(address tokenAddress) externalDeposit tokens into the underlying Aave V3 lending pool
Parameters
tokenAddress
address
Token address
withdraw
function withdraw(address tokenAddress, address recipient, uint256 tokenAmount) externalWithdraw tokens from this adapter Only callable by the AssetManager
Parameters
tokenAddress
address
Token to withdraw
recipient
address
Recieved by
tokenAmount
uint256
Amount of tokens to withdraw
withdrawAll
function withdrawAll(address tokenAddress, address recipient) externalWithdraw all tokens from this adapter Only callable by the AssetManager
Parameters
tokenAddress
address
Token to withdraw
recipient
address
Recieved by
claimRewards
function claimRewards(address tokenAddress, address recipient) externalClaim rewards from the Aave rewards controller
Parameters
tokenAddress
address
Token address
recipient
address
The recipient
_getSupply
function _getSupply(address tokenAddress) internal view returns (uint256)_supportsToken
function _supportsToken(address tokenAddress) internal view returns (bool)Last updated
Was this helpful?