Constants

Git Source

State Variables

PERMIT2

permit2 contract, deployed to same address on EVM networks, see https://github.com/Uniswap/permit2

IAllowanceTransfer internal constant PERMIT2 = IAllowanceTransfer(0x000000000022D473030F116dDEE9F6B43aC78BA3);

EXCHANGE_PRICES_PRECISION

precision for exchange prices

uint256 internal constant EXCHANGE_PRICES_PRECISION = 1e12;

SECONDS_PER_YEAR

Ignoring leap years

uint256 internal constant SECONDS_PER_YEAR = 365 days;

MAX_REWARDS_RATE

max allowed reward rate is 50%

uint256 internal constant MAX_REWARDS_RATE = 50 * 1e12;

LIQUIDITY

address of the Liquidity contract.

IFluidLiquidity internal immutable LIQUIDITY;

LENDING_FACTORY

address of the Lending factory contract.

IFluidLendingFactory internal immutable LENDING_FACTORY;

ASSET

address of the underlying asset contract.

IERC20 internal immutable ASSET;

DECIMALS

number of decimals for the fToken, same as ASSET

uint8 internal immutable DECIMALS;

LIQUIDITY_EXCHANGE_PRICES_SLOT

slot ids in Liquidity contract for underlying token. Helps in low gas fetch from liquidity contract by skipping delegate call with readFromStorage

bytes32 internal immutable LIQUIDITY_EXCHANGE_PRICES_SLOT;

LIQUIDITY_TOTAL_AMOUNTS_SLOT

bytes32 internal immutable LIQUIDITY_TOTAL_AMOUNTS_SLOT;

LIQUIDITY_USER_SUPPLY_SLOT

bytes32 internal immutable LIQUIDITY_USER_SUPPLY_SLOT;

Functions

constructor

constructor(IFluidLiquidity liquidity_, IFluidLendingFactory lendingFactory_, IERC20 asset_);

Parameters

NameTypeDescription
liquidity_IFluidLiquidityliquidity contract address
lendingFactory_IFluidLendingFactorylending factory contract address
asset_IERC20underlying token address

_getLiquiditySlotLinksAsset

gets asset address for liquidity slot links, extracted to separate method so it can be overridden if needed

function _getLiquiditySlotLinksAsset() internal view virtual returns (address);