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
Name | Type | Description |
---|---|---|
[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
Name | Type | Description |
---|---|---|
[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
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
getReserveCaps
Returns the caps parameters of the reserve
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | True if the asset is siloed for borrowing |
getLiquidationProtocolFee
Returns the protocol fee on the liquidation bonus
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The protocol fee on liquidation |
getReserveData
Returns the reserve data
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The total supply of the xToken |
getTotalDebt
Returns the total debt for a given asset
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The total debt for asset |
getUserReserveData
Returns the user data in a reserve
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
user | address | The address of the user |
Return Values
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
asset | address | The address of the underlying asset of the reserve |
Return Values
Name | Type | Description |
---|---|---|
interestRateStrategyAddress | address | The address of the Interest Rate strategy |
auctionStrategyAddress | address | The address of the Auction strategy |