IFluidLiquidityResolver
Functions
getRevenue
gets the revenueAmount_
for a token_
.
function getRevenue(address token_) external view returns (uint256 revenueAmount_);
getRevenueCollector
address of contract that gets sent the revenue. Configurable by governance
function getRevenueCollector() external view returns (address);
getStatus
Liquidity contract paused status: status = 1 -> normal. status = 2 -> paused.
function getStatus() external view returns (uint256);
isAuth
checks if auth_
is an allowed auth on Liquidity.
Auths can set most config values. E.g. contracts that automate certain flows like e.g. adding a new fToken.
Governance can add/remove auths. Governance is auth by default.
function isAuth(address auth_) external view returns (uint256);
isGuardian
checks if guardian_
is an allowed Guardian on Liquidity.
Guardians can pause lower class users.
Governance can add/remove guardians. Governance is guardian by default.
function isGuardian(address guardian_) external view returns (uint256);
getUserClass
gets user class for user_
. Class defines which protocols can be paused by guardians.
Currently there are 2 classes: 0 can be paused by guardians. 1 cannot be paused by guardians.
New protocols are added as class 0 and will be upgraded to 1 over time.
function getUserClass(address user_) external view returns (uint256);
getExchangePricesAndConfig
gets exchangePricesAndConfig packed uint256 storage slot for token_
.
function getExchangePricesAndConfig(address token_) external view returns (uint256);
getRateConfig
gets rateConfig packed uint256 storage slot for token_
.
function getRateConfig(address token_) external view returns (uint256);
getTotalAmounts
gets totalAmounts packed uint256 storage slot for token_
.
function getTotalAmounts(address token_) external view returns (uint256);
getUserSupply
gets userSupply data packed uint256 storage slot for user_
and token_
.
function getUserSupply(address user_, address token_) external view returns (uint256);
getUserBorrow
gets userBorrow data packed uint256 storage slot for user_
and token_
.
function getUserBorrow(address user_, address token_) external view returns (uint256);
listedTokens
returns all listedTokens_
at the Liquidity contract. Once configured, a token can never be removed.
function listedTokens() external view returns (address[] memory listedTokens_);
getTokenRateData
get the Rate config data rateData_
for a token_
compiled from the packed uint256 rateConfig storage slot
function getTokenRateData(address token_) external view returns (LiquidityStructs.RateData memory rateData_);
getTokensRateData
get the Rate config datas rateDatas_
for multiple tokens_
compiled from the packed uint256 rateConfig storage slot
function getTokensRateData(address[] calldata tokens_)
external
view
returns (LiquidityStructs.RateData[] memory rateDatas_);
getOverallTokenData
returns general data for token_
such as rates, exchange prices, utilization, fee, total amounts etc.
function getOverallTokenData(address token_)
external
view
returns (LiquidityStructs.OverallTokenData memory overallTokenData_);
getOverallTokensData
returns general data for multiple tokens_
such as rates, exchange prices, utilization, fee, total amounts etc.
function getOverallTokensData(address[] calldata tokens_)
external
view
returns (LiquidityStructs.OverallTokenData[] memory overallTokensData_);
getUserSupplyData
returns user_
supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for token_
function getUserSupplyData(address user_, address token_)
external
view
returns (
LiquidityStructs.UserSupplyData memory userSupplyData_,
LiquidityStructs.OverallTokenData memory overallTokenData_
);
getUserMultipleSupplyData
returns user_
supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple tokens_
function getUserMultipleSupplyData(address user_, address[] calldata tokens_)
external
view
returns (
LiquidityStructs.UserSupplyData[] memory userSuppliesData_,
LiquidityStructs.OverallTokenData[] memory overallTokensData_
);
getUserBorrowData
returns user_
borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for token_
function getUserBorrowData(address user_, address token_)
external
view
returns (
LiquidityStructs.UserBorrowData memory userBorrowData_,
LiquidityStructs.OverallTokenData memory overallTokenData_
);
getUserMultipleBorrowData
returns user_
borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple tokens_
function getUserMultipleBorrowData(address user_, address[] calldata tokens_)
external
view
returns (
LiquidityStructs.UserBorrowData[] memory userBorrowingsData_,
LiquidityStructs.OverallTokenData[] memory overallTokensData_
);
getUserMultipleBorrowSupplyData
returns user_
supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple supplyTokens_
and returns user_
borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple borrowTokens_
function getUserMultipleBorrowSupplyData(
address user_,
address[] calldata supplyTokens_,
address[] calldata borrowTokens_
)
external
view
returns (
LiquidityStructs.UserSupplyData[] memory userSuppliesData_,
LiquidityStructs.OverallTokenData[] memory overallSupplyTokensData_,
LiquidityStructs.UserBorrowData[] memory userBorrowingsData_,
LiquidityStructs.OverallTokenData[] memory overallBorrowTokensData_
);