IFluidLendingResolver
Functions
LENDING_FACTORY
returns the lending factory address
function LENDING_FACTORY() external view returns (IFluidLendingFactory);
LIQUIDITY_RESOLVER
returns the liquidity resolver address
function LIQUIDITY_RESOLVER() external view returns (IFluidLiquidityResolver);
getAllFTokenTypes
returns all fToken types at the LENDING_FACTORY
function getAllFTokenTypes() external view returns (string[] memory);
getAllFTokens
returns all created fTokens at the LENDING_FACTORY
function getAllFTokens() external view returns (address[] memory);
isLendingFactoryAuth
reads if a certain auth_
address is an allowed auth or not. Owner is auth by default.
function isLendingFactoryAuth(address auth_) external view returns (bool);
isLendingFactoryDeployer
reads if a certain deployer_
address is an allowed deployer or not. Owner is deployer by default.
function isLendingFactoryDeployer(address deployer_) external view returns (bool);
computeFToken
computes deterministic token address for asset_
for a lending protocol
function computeFToken(address asset_, string calldata fTokenType_) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
asset_ | address | address of the asset |
fTokenType_ | string | type of fToken: - if underlying asset supports EIP-2612, the fToken should be type EIP2612Deposits - otherwise it should use Permit2Deposits - if it's the native token, it should use NativeUnderlying - could be more types available, check fTokenTypes() |
Returns
Name | Type | Description |
---|---|---|
<none> | address | token_ detemrinistic address of the computed token |
getFTokenDetails
gets all public details for a certain fToken_
, such as
fToken type, name, symbol, decimals, underlying asset, total amounts, convertTo values, rewards.
Note it also returns whether the fToken supports deposits / mints via EIP-2612, but it is not a 100% guarantee!
To make sure, check for the underlying if it supports EIP-2612 manually.
function getFTokenDetails(IFToken fToken_) external view returns (Structs.FTokenDetails memory fTokenDetails_);
Parameters
Name | Type | Description |
---|---|---|
fToken_ | IFToken | the fToken to get the details for |
Returns
Name | Type | Description |
---|---|---|
fTokenDetails_ | Structs.FTokenDetails | retrieved FTokenDetails struct |
getFTokenInternalData
returns config, rewards and exchange prices data of an fToken.
function getFTokenInternalData(IFToken fToken_)
external
view
returns (
IFluidLiquidity liquidity_,
IFluidLendingFactory lendingFactory_,
IFluidLendingRewardsRateModel lendingRewardsRateModel_,
IAllowanceTransfer permit2_,
address rebalancer_,
bool rewardsActive_,
uint256 liquidityBalance_,
uint256 liquidityExchangePrice_,
uint256 tokenExchangePrice_
);
Parameters
Name | Type | Description |
---|---|---|
fToken_ | IFToken | the fToken to get the data for |
Returns
Name | Type | Description |
---|---|---|
liquidity_ | IFluidLiquidity | address of the Liquidity contract. |
lendingFactory_ | IFluidLendingFactory | address of the Lending factory contract. |
lendingRewardsRateModel_ | IFluidLendingRewardsRateModel | address of the rewards rate model contract. changeable by LendingFactory auths. |
permit2_ | IAllowanceTransfer | address of the Permit2 contract used for deposits / mint with signature |
rebalancer_ | address | address of the rebalancer allowed to execute rebalance() |
rewardsActive_ | bool | true if rewards are currently active |
liquidityBalance_ | uint256 | current Liquidity supply balance of address(this) for the underyling asset |
liquidityExchangePrice_ | uint256 | (updated) exchange price for the underlying assset in the liquidity protocol (without rewards) |
tokenExchangePrice_ | uint256 | (updated) exchange price between fToken and the underlying assset (with rewards) |
getFTokensEntireData
gets all public details for all itokens, such as fToken type, name, symbol, decimals, underlying asset, total amounts, convertTo values, rewards
function getFTokensEntireData() external view returns (Structs.FTokenDetails[] memory);
getUserPositions
gets all public details for all itokens, such as fToken type, name, symbol, decimals, underlying asset, total amounts, convertTo values, rewards and user position for each token
function getUserPositions(address user_) external view returns (Structs.FTokenDetailsUserPosition[] memory);
getFTokenRewards
gets rewards related data: the rewardsRateModel_
contract and the current rewardsRate_
for the fToken_
function getFTokenRewards(IFToken fToken_)
external
view
returns (IFluidLendingRewardsRateModel rewardsRateModel_, uint256 rewardsRate_);
getFTokenRewardsRateModelConfig
gets rewards rate model config constants
function getFTokenRewardsRateModelConfig(IFToken fToken_)
external
view
returns (
uint256 duration_,
uint256 startTime_,
uint256 endTime_,
uint256 startTvl_,
uint256 maxRate_,
uint256 rewardAmount_,
address initiator_
);
getUserPosition
gets a user_
position for an fToken_
.
function getUserPosition(IFToken fToken_, address user_)
external
view
returns (Structs.UserPosition memory userPosition);
Returns
Name | Type | Description |
---|---|---|
userPosition | Structs.UserPosition | user position struct |
getPreviews
gets fToken_
preview amounts for assets_
or shares_
.
function getPreviews(IFToken fToken_, uint256 assets_, uint256 shares_)
external
view
returns (uint256 previewDeposit_, uint256 previewMint_, uint256 previewWithdraw_, uint256 previewRedeem_);
Returns
Name | Type | Description |
---|---|---|
previewDeposit_ | uint256 | preview for deposit of assets_ |
previewMint_ | uint256 | preview for mint of shares_ |
previewWithdraw_ | uint256 | preview for withdraw of assets_ |
previewRedeem_ | uint256 | preview for redeem of shares_ |