Skip to content

IFluidLendingResolver ​

Git Source

Functions ​

LENDING_FACTORY ​

returns the lending factory address

solidity
function LENDING_FACTORY() external view returns (IFluidLendingFactory);

LIQUIDITY_RESOLVER ​

returns the liquidity resolver address

solidity
function LIQUIDITY_RESOLVER() external view returns (IFluidLiquidityResolver);

getDeploymentName ​

returns the factory deployment name when present (permissioned stack); empty string on production factories.

solidity
function getDeploymentName() external view returns (string memory);

getAllFTokenTypes ​

returns all fToken types at the LENDING_FACTORY

solidity
function getAllFTokenTypes() external view returns (string[] memory);

getAllFTokens ​

returns all created fTokens at the LENDING_FACTORY

solidity
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.

solidity
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.

solidity
function isLendingFactoryDeployer(address deployer_) external view returns (bool);

computeFToken ​

computes deterministic token address for asset_ for a lending protocol

solidity
function computeFToken(address asset_, string calldata fTokenType_) external view returns (address);

Parameters

NameTypeDescription
asset_addressaddress of the asset
fTokenType_stringtype 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

NameTypeDescription
<none>addresstoken_ 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, and APR fields. 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.

All resolver APR fields use Liquidity scale (100 = 1%, divide by 100 for % display).

solidity
function getFTokenDetails(IFToken fToken_) external view returns (Structs.FTokenDetails memory fTokenDetails_);

Parameters

NameTypeDescription
fToken_IFTokenthe fToken to get the details for

Returns

NameTypeDescription
fTokenDetails_Structs.FTokenDetailsretrieved FTokenDetails struct

getFTokenInternalData ​

returns config, rewards and exchange prices data of an fToken.

solidity
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

NameTypeDescription
fToken_IFTokenthe fToken to get the data for

Returns

NameTypeDescription
liquidity_IFluidLiquidityaddress of the Liquidity contract.
lendingFactory_IFluidLendingFactoryaddress of the Lending factory contract.
lendingRewardsRateModel_IFluidLendingRewardsRateModeladdress of the rewards rate model contract. changeable by LendingFactory auths.
permit2_IAllowanceTransferaddress of the Permit2 contract used for deposits / mint with signature
rebalancer_addressaddress of the rebalancer allowed to execute rebalance()
rewardsActive_booltrue if rewards are currently active
liquidityBalance_uint256current 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

solidity
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

solidity
function getUserPositions(address user_) external view returns (Structs.FTokenDetailsUserPosition[] memory);

getFTokenRewards ​

All APR fields use Liquidity resolver scale (100 = 1%). Streaming totalRate_ is liquidityRate_ + relativeModelRate_ (additive per fToken exchange-price math, not multiplicative). Static staticModelRate_ is the signed Liquidity offset; totalRate_ = max(0, liquidityRate_ + staticModelRate_). rewardsActive_ is true while the wired program is currently accruing (false after stop/natural end even if the model remains wired — e.g. isStaticRate_ may still be true).

solidity
function getFTokenRewards(IFToken fToken_)
    external
    view
    returns (
        IFluidLendingRewardsRateModel rewardsRateModel_,
        uint256 relativeModelRate_,
        int256 staticModelRate_,
        bool isStaticRate_,
        uint256 liquidityRate_,
        uint256 totalRate_,
        bool rewardsActive_
    );

getFTokenRewardsRateModelConfig ​

gets rewards rate model config constants.

Tuple shape is shared for streaming and static models. All fields are raw on-chain values (1e12 = 1% for rate fields), unlike APR fields on getFTokenDetails (100 = 1%). maxRateOrStaticRate_: streaming = model max-rate ceiling (>= 0); static = signed Liquidity offset from getStaticConfig().staticRate (may be negative). Static |offset| ceiling remains getStaticConfig().maxRate. Static: startTvl_ and rewardAmount_ are 0.

solidity
function getFTokenRewardsRateModelConfig(IFToken fToken_)
    external
    view
    returns (
        uint256 duration_,
        uint256 startTime_,
        uint256 endTime_,
        uint256 startTvl_,
        int256 maxRateOrStaticRate_,
        uint256 rewardAmount_,
        address configurator_
    );

getUserPosition ​

gets a user_ position for an fToken_.

solidity
function getUserPosition(IFToken fToken_, address user_)
    external
    view
    returns (Structs.UserPosition memory userPosition);

Returns

NameTypeDescription
userPositionStructs.UserPositionuser position struct

getPreviews ​

gets fToken_ preview amounts for assets_ or shares_.

solidity
function getPreviews(IFToken fToken_, uint256 assets_, uint256 shares_)
    external
    view
    returns (uint256 previewDeposit_, uint256 previewMint_, uint256 previewWithdraw_, uint256 previewRedeem_);

Returns

NameTypeDescription
previewDeposit_uint256preview for deposit of assets_
previewMint_uint256preview for mint of shares_
previewWithdraw_uint256preview for withdraw of assets_
previewRedeem_uint256preview for redeem of shares_