mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Renaming
This commit is contained in:
parent
3400d3b2a8
commit
498a5b5e1f
|
@ -22,8 +22,8 @@ interface IUiPoolDataProvider {
|
|||
bool isFreezed;
|
||||
ReserveLogic.ReserveData baseData;
|
||||
uint256 availableLiquidity;
|
||||
uint256 totalBorrowsStable;
|
||||
uint256 totalBorrowsVariable;
|
||||
uint256 totalPrincipalStableDebt;
|
||||
uint256 totalScaledVariableDebt;
|
||||
uint256 utilizationRate;
|
||||
uint256 priceInEth;
|
||||
uint256 variableRateSlope1;
|
||||
|
@ -39,11 +39,11 @@ interface IUiPoolDataProvider {
|
|||
|
||||
struct UserReserveData {
|
||||
address underlyingAsset;
|
||||
uint256 principalATokenBalance;
|
||||
uint256 scaledATokenBalance;
|
||||
bool usageAsCollateralEnabledOnUser;
|
||||
uint256 stableBorrowRate;
|
||||
uint256 principalVariableBorrows;
|
||||
uint256 principalStableBorrows;
|
||||
uint256 scaledVariableDebt;
|
||||
uint256 principalStableDebt;
|
||||
uint256 stableBorrowLastUpdateTimestamp;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,15 +72,20 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf(
|
||||
reserveData.baseData.aTokenAddress
|
||||
);
|
||||
reserveData.totalBorrowsStable = IERC20Detailed(reserveData.baseData.stableDebtTokenAddress)
|
||||
reserveData.totalPrincipalStableDebt = IERC20Detailed(
|
||||
reserveData
|
||||
.baseData
|
||||
.stableDebtTokenAddress
|
||||
)
|
||||
.totalSupply();
|
||||
reserveData.totalBorrowsVariable = IERC20Detailed(
|
||||
reserveData.totalScaledVariableDebt = IERC20Detailed(
|
||||
reserveData
|
||||
.baseData
|
||||
.variableDebtTokenAddress
|
||||
)
|
||||
.totalSupply();
|
||||
uint256 totalBorrows = reserveData.totalBorrowsStable + reserveData.totalBorrowsVariable;
|
||||
uint256 totalBorrows = reserveData.totalPrincipalStableDebt +
|
||||
reserveData.totalScaledVariableDebt;
|
||||
reserveData.utilizationRate = totalBorrows == 0
|
||||
? 0
|
||||
: totalBorrows.rayDiv(totalBorrows + reserveData.availableLiquidity);
|
||||
|
@ -117,24 +122,24 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
|
|||
if (user != address(0)) {
|
||||
// user reserve data
|
||||
userReservesData[i].underlyingAsset = reserveData.underlyingAsset;
|
||||
userReservesData[i].principalATokenBalance = IAToken(reserveData.baseData.aTokenAddress)
|
||||
userReservesData[i].scaledATokenBalance = IAToken(reserveData.baseData.aTokenAddress)
|
||||
.scaledBalanceOf(user);
|
||||
userReservesData[i].usageAsCollateralEnabledOnUser = userConfig.isUsingAsCollateral(i);
|
||||
|
||||
if (userConfig.isBorrowing(i)) {
|
||||
userReservesData[i].principalVariableBorrows = IVariableDebtToken(
|
||||
userReservesData[i].scaledVariableDebt = IVariableDebtToken(
|
||||
reserveData
|
||||
.baseData
|
||||
.variableDebtTokenAddress
|
||||
)
|
||||
.scaledBalanceOf(user);
|
||||
userReservesData[i].principalStableBorrows = IStableDebtToken(
|
||||
userReservesData[i].principalStableDebt = IStableDebtToken(
|
||||
reserveData
|
||||
.baseData
|
||||
.stableDebtTokenAddress
|
||||
)
|
||||
.principalBalanceOf(user);
|
||||
if (userReservesData[i].principalStableBorrows != 0) {
|
||||
if (userReservesData[i].principalStableDebt != 0) {
|
||||
userReservesData[i].stableBorrowRate = IStableDebtToken(
|
||||
reserveData
|
||||
.baseData
|
||||
|
|
Loading…
Reference in New Issue
Block a user