fTokenViews

Git Source

Inherits:fTokenCore

fToken view methods. Implements view methods for ERC4626 compatibility

Functions

getData

returns config, rewards and exchange prices data in a single view method.

function getData()
    public
    view
    returns (
        IFluidLiquidity liquidity_,
        IFluidLendingFactory lendingFactory_,
        IFluidLendingRewardsRateModel lendingRewardsRateModel_,
        IAllowanceTransfer permit2_,
        address rebalancer_,
        bool rewardsActive_,
        uint256 liquidityBalance_,
        uint256 liquidityExchangePrice_,
        uint256 tokenExchangePrice_
    );

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)

asset

function asset() public view virtual override returns (address);

totalAssets

function totalAssets() public view virtual override returns (uint256);

convertToShares

function convertToShares(uint256 assets_) public view virtual override returns (uint256);

convertToAssets

function convertToAssets(uint256 shares_) public view virtual override returns (uint256);

previewDeposit

returned amount might be slightly different from actual amount at execution.

function previewDeposit(uint256 assets_) public view virtual override returns (uint256);

previewMint

function previewMint(uint256 shares_) public view virtual override returns (uint256);

previewWithdraw

function previewWithdraw(uint256 assets_) public view virtual override returns (uint256);

previewRedeem

returned amount might be slightly different from actual amount at execution.

function previewRedeem(uint256 shares_) public view virtual override returns (uint256);

maxDeposit

function maxDeposit(address) public view virtual override returns (uint256);

maxMint

function maxMint(address) public view virtual override returns (uint256);

maxWithdraw

function maxWithdraw(address owner_) public view virtual override returns (uint256);

maxRedeem

function maxRedeem(address owner_) public view virtual override returns (uint256);

minDeposit

returns minimum amount required for deposit (rounded up)

function minDeposit() public view returns (uint256);