FluidLiquidityResolver
Inherits:IFluidLiquidityResolver, Variables, Structs
Fluid Liquidity resolver Implements various view-only methods to give easy access to Liquidity data.
State Variables
_NATIVE_TOKEN_ADDRESS
address that is mapped to the chain native token
address internal constant _NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
Functions
constructor
constructor(IFluidLiquidity liquidity_) Variables(liquidity_);
getRevenueCollector
address of contract that gets sent the revenue. Configurable by governance
function getRevenueCollector() public view returns (address);
getRevenue
gets the revenueAmount_
for a token_
.
function getRevenue(address token_) public view returns (uint256 revenueAmount_);
getStatus
Liquidity contract paused status: status = 1 -> normal. status = 2 -> paused.
function getStatus() public 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_) public 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_) public 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_) public view returns (uint256);
getExchangePricesAndConfig
gets exchangePricesAndConfig packed uint256 storage slot for token_
.
function getExchangePricesAndConfig(address token_) public view returns (uint256);
getRateConfig
gets rateConfig packed uint256 storage slot for token_
.
function getRateConfig(address token_) public view returns (uint256);
getTotalAmounts
gets totalAmounts packed uint256 storage slot for token_
.
function getTotalAmounts(address token_) public view returns (uint256);
getUserSupply
gets userSupply data packed uint256 storage slot for user_
and token_
.
function getUserSupply(address user_, address token_) public view returns (uint256);
getUserBorrow
gets userBorrow data packed uint256 storage slot for user_
and token_
.
function getUserBorrow(address user_, address token_) public view returns (uint256);
listedTokens
returns all listedTokens_
at the Liquidity contract. Once configured, a token can never be removed.
function listedTokens() public 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_) public view returns (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_) public view returns (RateData[] memory rateDatas_);
getOverallTokenData
returns general data for token_
such as rates, exchange prices, utilization, fee, total amounts etc.
function getOverallTokenData(address token_) public view returns (Structs.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_)
public
view
returns (Structs.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_)
public
view
returns (Structs.UserSupplyData memory userSupplyData_, Structs.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_)
public
view
returns (Structs.UserSupplyData[] memory userSuppliesData_, Structs.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_)
public
view
returns (Structs.UserBorrowData memory userBorrowData_, Structs.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_)
public
view
returns (Structs.UserBorrowData[] memory userBorrowingsData_, Structs.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_
)
public
view
returns (
Structs.UserSupplyData[] memory userSuppliesData_,
Structs.OverallTokenData[] memory overallSupplyTokensData_,
Structs.UserBorrowData[] memory userBorrowingsData_,
Structs.OverallTokenData[] memory overallBorrowTokensData_
);
Errors
FluidLiquidityResolver__AddressZero
thrown if an input param address is zero
error FluidLiquidityResolver__AddressZero();
- State Variables
- Functions
- constructor
- getRevenueCollector
- getRevenue
- getStatus
- isAuth
- isGuardian
- getUserClass
- getExchangePricesAndConfig
- getRateConfig
- getTotalAmounts
- getUserSupply
- getUserBorrow
- listedTokens
- getTokenRateData
- getTokensRateData
- getOverallTokenData
- getOverallTokensData
- getUserSupplyData
- getUserMultipleSupplyData
- getUserBorrowData
- getUserMultipleBorrowData
- getUserMultipleBorrowSupplyData
- Errors