AaveV3Adapter

The implementation of Aave.Finance MoneyMarket that integrates with AssetManager.

assetManager

address assetManager

the AssetManager contract address

market

contract AMarket3 market

Aave Market contract

lendingPool

contract LendingPool3 lendingPool

Aave Lending pool contract

tokenToAToken

mapping(address => address) tokenToAToken

Mapping of token to aToken

floorMap

mapping(address => uint256) floorMap

Mapping of token to floor amount

ceilingMap

mapping(address => uint256) ceilingMap

Mapping 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) public

TokenNotSupported

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) external

Set the asset manager contract address Only callable by the admin

Parameters

NameTypeDescription

_assetManager

address

AssetManager contract address

setFloor

function setFloor(address tokenAddress, uint256 floor) external

Set floor amount Only callable by the admin

Parameters

NameTypeDescription

tokenAddress

address

Address of the token to set the floor for

floor

uint256

Floor amount

setCeiling

function setCeiling(address tokenAddress, uint256 ceiling) external

Set ceiling amount Only callable by the admin

Parameters

NameTypeDescription

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

NameTypeDescription

tokenAddress

address

The underlying token address

getSupply

function getSupply(address tokenAddress) external view returns (uint256)

Get total supply of this Contracts

Parameters

NameTypeDescription

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

NameTypeDescription

tokenAddress

address

The token to check supply for

supportsToken

function supportsToken(address tokenAddress) external view returns (bool)

Check if this token is supported

Parameters

NameTypeDescription

tokenAddress

address

The token to check

mapTokenToAToken

function mapTokenToAToken(address tokenAddress) external

Add aToken to the token mapping for a supported token

Parameters

NameTypeDescription

tokenAddress

address

Token address

deposit

function deposit(address tokenAddress) external

Deposit tokens into the underlying Aave V3 lending pool

Parameters

NameTypeDescription

tokenAddress

address

Token address

withdraw

function withdraw(address tokenAddress, address recipient, uint256 tokenAmount) external

Withdraw tokens from this adapter Only callable by the AssetManager

Parameters

NameTypeDescription

tokenAddress

address

Token to withdraw

recipient

address

Recieved by

tokenAmount

uint256

Amount of tokens to withdraw

withdrawAll

function withdrawAll(address tokenAddress, address recipient) external

Withdraw all tokens from this adapter Only callable by the AssetManager

Parameters

NameTypeDescription

tokenAddress

address

Token to withdraw

recipient

address

Recieved by

claimRewards

function claimRewards(address tokenAddress, address recipient) external

Claim rewards from the Aave rewards controller

Parameters

NameTypeDescription

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