FluidLendingStaticRateModel ​
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)
modifier onlyConfigurator() ;constructor ​
Sets variables for static rate configuration.
constructor(
address configurator_,
address fToken_,
address fToken2_,
address fToken3_,
int256 initialRate_,
uint256 duration_
) ;Parameters
| Name | Type | Description |
|---|---|---|
configurator_ | address | The address with authority to configure the static rate. |
fToken_ | address | The address of the associated fToken contract. |
fToken2_ | address | The address of the associated fToken contract 2, optional. |
fToken3_ | address | The address of the associated fToken contract 3, optional. |
initialRate_ | int256 | Signed APR offset (1e12 = 1%), within ±MAX_RATE. |
duration_ | uint256 | Duration 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.
function getStaticConfig()
external
view
returns (int256 staticRate_, uint256 duration_, uint256 startTime_, address configurator_, uint256 maxRate_);Returns
| Name | Type | Description |
|---|---|---|
staticRate_ | int256 | signed APR offset (1e12 = 1%), same value as getRateV2 while the period is current |
duration_ | uint256 | duration in seconds for the current rate period |
startTime_ | uint256 | when the current rate period started |
configurator_ | address | address with authority to configure the static rate |
maxRate_ | uint256 | hard ceiling on ` |
getConfig ​
Legacy streaming config shape. Always zeros: use getStaticConfig.
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.
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.
function getRateV2(
uint256 /**
* totalAssets_
*/
)
public
view
returns (int256 rate_, bool ended_, uint256 startTime_, uint256 endTime_);Returns
| Name | Type | Description |
|---|---|---|
rate_ | int256 | signed 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_ | bool | true after startTime + duration (mirrors streaming getRateV2 ended semantics). |
startTime_ | uint256 | accrual start time for the current rate period |
endTime_ | uint256 | end time of the current rate period (startTime + duration) |
setStaticRate ​
Updates the signed APR offset and duration. Callable only by configurator.
function setStaticRate(int256 rate_, uint256 duration_) external onlyConfigurator;Parameters
| Name | Type | Description |
|---|---|---|
rate_ | int256 | signed APR offset with 1e12 = 1% (e.g. 1e12 = +1% on Liquidity, -3e12 = −3%) |
duration_ | uint256 | duration 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).
function stopStaticRate() external onlyConfigurator;_isOutsideMaxRate ​
function _isOutsideMaxRate(int256 rate_) internal pure returns (bool);