ProtocolDataProvider
Peripheral contract to collect and pre-process information from the Pool.
MKR
ETH
ADDRESSES_PROVIDER
constructor
getAllReservesTokens
Returns the list of the existing reserves in the pool.
Handling MKR and ETH in a different way since they do not have standard symbol
functions.
Return Values
[0]
struct DataTypes.TokenData[]
The list of reserves, pairs of symbols and addresses
getAllXTokens
Returns the list of the existing XTokens(PToken+NToken) in the pool.
Return Values
[0]
struct DataTypes.TokenData[]
The list of XTokens, pairs of symbols and addresses
getReserveConfigurationData
Returns the configuration data of the reserve
Not returning borrow and supply caps for compatibility, nor pause flag
Parameters
asset
address
The address of the underlying asset of the reserve
getReserveCaps
Returns the caps parameters of the reserve
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
borrowCap
uint256
borrowCap The borrow cap of the reserve
supplyCap
uint256
supplyCap The supply cap of the reserve
getSiloedBorrowing
Returns the siloed borrowing flag
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
[0]
bool
True if the asset is siloed for borrowing
getLiquidationProtocolFee
Returns the protocol fee on the liquidation bonus
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
[0]
uint256
The protocol fee on liquidation
getReserveData
Returns the reserve data
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
accruedToTreasuryScaled
uint256
The scaled amount of tokens accrued to treasury that is to be minted
totalPToken
uint256
The total supply of the xToken
totalVariableDebt
uint256
The total variable debt of the reserve
liquidityRate
uint256
The liquidity rate of the reserve
variableBorrowRate
uint256
The variable borrow rate of the reserve
liquidityIndex
uint256
The liquidity index of the reserve
variableBorrowIndex
uint256
The variable borrow index of the reserve
lastUpdateTimestamp
uint40
The timestamp of the last update of the reserve
getXTokenTotalSupply
Returns the total supply of xTokens for a given asset
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
[0]
uint256
The total supply of the xToken
getTotalDebt
Returns the total debt for a given asset
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
[0]
uint256
The total debt for asset
getUserReserveData
Returns the user data in a reserve
Parameters
asset
address
The address of the underlying asset of the reserve
user
address
The address of the user
Return Values
currentXTokenBalance
uint256
The current XToken balance of the user
scaledXTokenBalance
uint256
The scaled XToken balance of the user
collateralizedBalance
uint256
The collateralized balance of the user
currentVariableDebt
uint256
The current variable debt of the user
scaledVariableDebt
uint256
The scaled variable debt of the user
liquidityRate
uint256
The liquidity rate of the reserve
usageAsCollateralEnabled
bool
True if the user is using the asset as collateral, false otherwise
getReserveTokensAddresses
Returns the token addresses of the reserve
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
xTokenAddress
address
The PToken address of the reserve
variableDebtTokenAddress
address
The VariableDebtToken address of the reserve
getStrategyAddresses
Returns the address of the Interest Rate strategy
Parameters
asset
address
The address of the underlying asset of the reserve
Return Values
interestRateStrategyAddress
address
The address of the Interest Rate strategy
auctionStrategyAddress
address
The address of the Auction strategy