Protocol Data Provider
Last updated
Last updated
The purpose of this contract is to help integrators and developers more easily leverage the Phantazm Protocol data and features.
function getAllReservesTokens()
Returns an array of all reserve tokens for the current market, in the form of a TokenData struct consisting of the token symbol and token address.
TokenData[ ]
A struct consisting of a symbol
of type string and tokenAddress
of type address
function getAllATokens()
Returns an array of all aTokens for the current market, in the form of a TokenData struct consisting of the token symbol and token address.
TokenData[ ]
A struct consisting of a symbol
of type string and tokenAddress
of type address
function getReserveConfigurationData(address asset)
Returns the configuration data for asset
.
uint256
decimals: the decimals used by the reserve
uint256
ltv: the Loan To Value
uint256
liquidationThreshold: the liquidation threshold of the reserve
uint256
liquidationBonus: the bonus awarded to liquidators
uint256
reserveFactor: the reserve factor
bool
usageAsCollateralEnabled: whether the reserve is enabled as collateral
bool
borrowingEnabled: whether borrowing is enabled on the reserve
bool
stableBorrowRateEnabled: whether stable borrowing is enabled
bool
isActive: whether the reserve is active
bool
isFrozen: whether the reserve is frozen / disabled
function getReserveData(address asset)
Returns the associated data for asset
.
uint256
availableLiquidity: the amount of liquidity available
uint256
totalStableDebt: the total amount of debt borrowed at the stable rate
uint256
totalVariableDebt: the total amount of debt borrowed at the variable rate
uint256
liquidityRate: the interest rate for deposits / adding liquidity
uint256
variableBorrowRate: the interest rate for borrowing at a variable rate
uint256
stableBorrowRate: the interest rate for borrowing at a stable rate
uint256
averageStableBorrowRate: the current average stable borrow rate
uint256
liquidityIndex: the index used in liquidity calculations
uint256
variableBorrowIndex: the index used in variable debt calculations
uint40
lastUpdateTimestamp: the timestamp of the reserve's last update
function getUserReserveData(address asset, address user)
Returns the user
's reserve data for asset
.
uint256
currentATokenBalance: current aToken balance of user
uint256
currentStableDebt: current stable debt the user
uint256
currentVariableDebt: current variable debt of the user
uint256
principalStableDebt: the principal stable debt of the user
uint256
scaledVariableDebt: the scaled variable debt of the user
uint256
stableBorrowRate: the stable borrow rate of the user
uint256
liquidityRate: the interest rate being earned by the user for deposits
uint40
stableRateLastUpdated: the timestamp of the last stable rate update
bool
usageAsCollateralEnabled: whether the reserve
is enabled as collateral for the user
function getReserveTokensAddresses(address asset)
Returns the associated addresses for an asset
address
aTokenAddress: the address of the tokenised deposit
address
stableDebtTokenAddress: the address of the tokenised stable rate debt
address
variableDebtTokenAddress: the address of the tokenised variable rate debt