Skip to content

IFluidLendingRewardsRateModel ​

Git Source

Functions ​

getRate ​

Calculates the current rewards rate (APR)

solidity
function getRate(uint256 totalAssets_) external view returns (uint256 rate_, bool ended_, uint256 startTime_);

Parameters

NameTypeDescription
totalAssets_uint256amount of assets in the lending

Returns

NameTypeDescription
rate_uint256rewards rate percentage per year with 1e12 RATE_PRECISION, e.g. 1e12 = 1%, 1e14 = 100%
ended_boolflag to signal that rewards have ended (always 0 going forward)
startTime_uint256start time of rewards to compare against last update timestamp

getRateV2 ​

Same as getRate but additionally returns the endTime_ of the reported rewards phase, and rate_ stays the actual phase rate even when ended_ is true. This allows fTokens to accrue rewards exactly up to endTime_ instead of losing the tail since their last exchange price update.

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

Parameters

NameTypeDescription
totalAssets_uint256amount of assets in the lending

Returns

NameTypeDescription
rate_int256rewards rate percentage per year with 1e12 RATE_PRECISION, e.g. 1e12 = 1%, 1e14 = 100%. Signed for a shared ABI with the static offset model; this streaming model always returns >= 0.
ended_boolflag to signal that rewards have ended
startTime_uint256start time of rewards to compare against last update timestamp
endTime_uint256end time of the reported rewards phase

getConfig ​

Returns config constants for rewards rate model

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