mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
principal and stable to total
This commit is contained in:
parent
498a5b5e1f
commit
7a8ed00909
|
@ -19,11 +19,11 @@ interface IUiPoolDataProvider {
|
|||
bool borrowingEnabled;
|
||||
bool stableBorrowRateEnabled;
|
||||
bool isActive;
|
||||
bool isFreezed;
|
||||
bool isFrozen;
|
||||
ReserveLogic.ReserveData baseData;
|
||||
uint256 availableLiquidity;
|
||||
uint256 totalPrincipalStableDebt;
|
||||
uint256 totalScaledVariableDebt;
|
||||
uint256 totalStableDebt;
|
||||
uint256 totalVariableDebt;
|
||||
uint256 utilizationRate;
|
||||
uint256 priceInEth;
|
||||
uint256 variableRateSlope1;
|
||||
|
|
|
@ -72,20 +72,11 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf(
|
||||
reserveData.baseData.aTokenAddress
|
||||
);
|
||||
reserveData.totalPrincipalStableDebt = IERC20Detailed(
|
||||
reserveData
|
||||
.baseData
|
||||
.stableDebtTokenAddress
|
||||
)
|
||||
reserveData.totalStableDebt = IERC20Detailed(reserveData.baseData.stableDebtTokenAddress)
|
||||
.totalSupply();
|
||||
reserveData.totalScaledVariableDebt = IERC20Detailed(
|
||||
reserveData
|
||||
.baseData
|
||||
.variableDebtTokenAddress
|
||||
)
|
||||
reserveData.totalVariableDebt = IERC20Detailed(reserveData.baseData.variableDebtTokenAddress)
|
||||
.totalSupply();
|
||||
uint256 totalBorrows = reserveData.totalPrincipalStableDebt +
|
||||
reserveData.totalScaledVariableDebt;
|
||||
uint256 totalBorrows = reserveData.totalStableDebt + reserveData.totalVariableDebt;
|
||||
reserveData.utilizationRate = totalBorrows == 0
|
||||
? 0
|
||||
: totalBorrows.rayDiv(totalBorrows + reserveData.availableLiquidity);
|
||||
|
@ -105,7 +96,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
) = reserveData.baseData.configuration.getParamsMemory();
|
||||
(
|
||||
reserveData.isActive,
|
||||
reserveData.isFreezed,
|
||||
reserveData.isFrozen,
|
||||
reserveData.borrowingEnabled,
|
||||
reserveData.stableBorrowRateEnabled
|
||||
) = reserveData.baseData.configuration.getFlagsMemory();
|
||||
|
|
Loading…
Reference in New Issue
Block a user