Skip to content

FluidLendingStaticRateModel ​

Git Source

Inherits:Variables, IFluidLendingStaticRateModel, Events, Error

Title: LendingStaticRateModel

Returns a signed APR offset (1e12 = 1%) for wired fTokens. The fToken itself applies Liquidity-layer supply yield ± this offset when compounding the share exchange price.

Also exposes legacy streaming getRate / getConfig as zero stubs (same selectors) so older LendingResolvers that always call those do not revert on static-wired fTokens. getRateV2 matches the streaming model's signed ABI (int256 rate) so fTokens use one call path for both model types.

Functions ​

onlyConfigurator ​

Validates that an address is the configurator (team multisig)

solidity
modifier onlyConfigurator() ;

constructor ​

Sets variables for static rate configuration.

solidity
constructor(
    address configurator_,
    address fToken_,
    address fToken2_,
    address fToken3_,
    int256 initialRate_,
    uint256 duration_
) ;

Parameters

NameTypeDescription
configurator_addressThe address with authority to configure the static rate.
fToken_addressThe address of the associated fToken contract.
fToken2_addressThe address of the associated fToken contract 2, optional.
fToken3_addressThe address of the associated fToken contract 3, optional.
initialRate_int256Signed APR offset (1e12 = 1%), within ±MAX_RATE.
duration_uint256Duration in seconds for which the rate runs.

getStaticConfig ​

Static-model config read. Named distinctly from legacy streaming getConfig() (7-tuple) so both can coexist on the same contract without selector / ABI-decode collisions.

solidity
function getStaticConfig()
    external
    view
    returns (int256 staticRate_, uint256 duration_, uint256 startTime_, address configurator_, uint256 maxRate_);

Returns

NameTypeDescription
staticRate_int256signed APR offset (1e12 = 1%), same value as getRateV2 while the period is current
duration_uint256duration in seconds for the current rate period
startTime_uint256when the current rate period started
configurator_addressaddress with authority to configure the static rate
maxRate_uint256hard ceiling on `

getConfig ​

Legacy streaming config shape. Always zeros: use getStaticConfig.

solidity
function getConfig()
    external
    pure
    returns (
        uint256 duration_,
        uint256 startTime_,
        uint256 endTime_,
        uint256 startTvl_,
        uint256 maxRate_,
        uint256 rewardAmount_,
        address configurator_
    );

getRate ​

Legacy streaming rate stub. Accrual uses signed getRateV2 on the fToken static path.

solidity
function getRate(
    uint256 /**
             * totalAssets_
             */
)
    external
    pure
    returns (uint256 rate_, bool ended_, uint256 startTime_);

getRateV2 ​

Signed APR offset feed for static-wired fTokens. Input totalAssets_ is ignored (TVL-independent).

Returns the configured signed offset only. fToken combines it with Liquidity yield.

solidity
function getRateV2(
    uint256 /**
             * totalAssets_
             */
)
    public
    view
    returns (int256 rate_, bool ended_, uint256 startTime_, uint256 endTime_);

Returns

NameTypeDescription
rate_int256signed APR offset with 1e12 = 1%. Positive = on top of Liquidity yield; negative = below. The fToken applies Liquidity supply yield ± this offset. Stays the configured offset even when ended_ is true so the fToken can settle accrual exactly up to endTime_.
ended_booltrue after startTime + duration (mirrors streaming getRateV2 ended semantics).
startTime_uint256accrual start time for the current rate period
endTime_uint256end time of the current rate period (startTime + duration)

setStaticRate ​

Updates the signed APR offset and duration. Callable only by configurator.

solidity
function setStaticRate(int256 rate_, uint256 duration_) external onlyConfigurator;

Parameters

NameTypeDescription
rate_int256signed APR offset with 1e12 = 1% (e.g. 1e12 = +1% on Liquidity, -3e12 = −3%)
duration_uint256duration in seconds

stopStaticRate ​

Stops the current static rate program instantly. Mirrors streaming stopRewards(). Settles fToken accrual via updateRates() only (does not re-wire the model on the fToken).

solidity
function stopStaticRate() external onlyConfigurator;

_isOutsideMaxRate ​

solidity
function _isOutsideMaxRate(int256 rate_) internal pure returns (bool);