aave-protocol-v2/contracts/misc/interfaces/IUiPoolDataProvider.sol

135 lines
3.6 KiB
Solidity
Raw Normal View History

2020-10-14 13:54:22 +00:00
// SPDX-License-Identifier: agpl-3.0
2020-11-20 10:45:20 +00:00
pragma solidity 0.6.12;
2020-10-14 13:54:22 +00:00
pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
2021-03-23 17:52:51 +00:00
import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
2020-10-14 13:54:22 +00:00
interface IUiPoolDataProvider {
struct AggregatedReserveData {
address underlyingAsset;
string name;
string symbol;
uint256 decimals;
uint256 baseLTVasCollateral;
uint256 reserveLiquidationThreshold;
uint256 reserveLiquidationBonus;
2020-10-14 13:54:22 +00:00
uint256 reserveFactor;
bool usageAsCollateralEnabled;
bool borrowingEnabled;
bool stableBorrowRateEnabled;
bool isActive;
2020-11-02 10:54:21 +00:00
bool isFrozen;
// base data
uint128 liquidityIndex;
uint128 variableBorrowIndex;
uint128 liquidityRate;
uint128 variableBorrowRate;
uint128 stableBorrowRate;
uint40 lastUpdateTimestamp;
address aTokenAddress;
address stableDebtTokenAddress;
address variableDebtTokenAddress;
address interestRateStrategyAddress;
//
2020-10-14 13:54:22 +00:00
uint256 availableLiquidity;
2020-11-02 11:41:53 +00:00
uint256 totalPrincipalStableDebt;
uint256 averageStableRate;
uint256 stableDebtLastUpdateTimestamp;
uint256 totalScaledVariableDebt;
2020-10-14 13:54:22 +00:00
uint256 priceInEth;
uint256 variableRateSlope1;
uint256 variableRateSlope2;
uint256 stableRateSlope1;
uint256 stableRateSlope2;
2021-03-23 17:52:51 +00:00
// incentives
uint128 aEmissionPerSecond;
uint128 vEmissionPerSecond;
uint128 sEmissionPerSecond;
uint256 aIncentivesLastUpdateTimestamp;
uint256 vIncentivesLastUpdateTimestamp;
uint256 sIncentivesLastUpdateTimestamp;
uint256 aTokenIncentivesIndex;
uint256 vTokenIncentivesIndex;
uint256 sTokenIncentivesIndex;
2020-10-14 13:54:22 +00:00
}
2021-03-23 17:52:51 +00:00
struct IncentivesDataUser {
address rewardToken;
uint256 userUnclaimedRewards;
2021-03-23 17:52:51 +00:00
uint256 rewardTokenDecimals;
uint256 rewardTokenPriceEth;
uint8 precision;
2021-03-23 17:52:51 +00:00
}
2020-10-14 13:54:22 +00:00
//
// struct ReserveData {
// uint256 averageStableBorrowRate;
// uint256 totalLiquidity;
// }
struct UserReserveData {
address underlyingAsset;
2020-11-02 09:37:24 +00:00
uint256 scaledATokenBalance;
2020-10-14 13:54:22 +00:00
bool usageAsCollateralEnabledOnUser;
uint256 stableBorrowRate;
2020-11-02 09:37:24 +00:00
uint256 scaledVariableDebt;
uint256 principalStableDebt;
2020-10-14 13:54:22 +00:00
uint256 stableBorrowLastUpdateTimestamp;
// incentives
uint256 aTokenincentivesUserIndex;
uint256 vTokenincentivesUserIndex;
uint256 sTokenincentivesUserIndex;
}
struct IncentivesAssetData {
uint128 emissionPerSecond;
uint128 lastUpdateTimestamp;
uint256 index;
2020-10-14 13:54:22 +00:00
}
//
// struct ATokenSupplyData {
// string name;
// string symbol;
// uint8 decimals;
// uint256 totalSupply;
// address aTokenAddress;
// }
2021-03-23 17:52:51 +00:00
function getReservesData(
ILendingPoolAddressesProvider provider,
IAaveIncentivesController incentives,
address user
)
2020-10-14 13:54:22 +00:00
external
view
returns (
AggregatedReserveData[] memory,
UserReserveData[] memory,
uint256,
IncentivesDataUser memory
2020-10-14 13:54:22 +00:00
);
// function getUserIncentivesBalance(
// ILendingPoolAddressesProvider provider,
// IAaveIncentivesController incentives,
// address user
// ) external view returns (IncentivesDataUser memory);
2021-03-23 17:52:51 +00:00
2020-10-14 13:54:22 +00:00
// function getUserReservesData(ILendingPoolAddressesProvider provider, address user)
// external
// view
// returns (UserReserveData[] memory);
//
// function getAllATokenSupply(ILendingPoolAddressesProvider provider)
// external
// view
// returns (ATokenSupplyData[] memory);
//
// function getATokenSupply(address[] calldata aTokens)
// external
// view
// returns (ATokenSupplyData[] memory);
}