Skip to content

FluidBufferRateHandler ​

Git Source

Inherits:Constants, Error, Events, FluidConfigHandler

Sets borrow rate for BORROW_TOKEN at Liquidaty based on supply rate of SUPPLY_TOKEN + buffer.

Functions ​

validAddress ​

Validates that an address is not the zero address

solidity
modifier validAddress(address value_);

onlyRebalancer ​

Validates that an address is a rebalancer (taken from reserve contract)

solidity
modifier onlyRebalancer();

constructor ​

solidity
constructor(
    IFluidReserveContract reserveContract_,
    IFluidLiquidity liquidity_,
    address supplyToken_,
    address borrowToken_,
    int256 rateBufferKink1_,
    int256 rateBufferKink2_,
    uint256 minUpdateDiff_
)
    validAddress(address(reserveContract_))
    validAddress(address(liquidity_))
    validAddress(supplyToken_)
    validAddress(borrowToken_);

configPercentDiff ​

solidity
function configPercentDiff() public view override returns (uint256 configPercentDiff_);

rebalance ​

solidity
function rebalance() external override onlyRebalancer;

calcBorrowRates ​

returns the current calculcated borrow rates at kink1 and kink 2 (for rate data v2).

solidity
function calcBorrowRates() public view returns (uint256 rateKink1_, uint256 rateKink2_);

supplyTokenLendingRate ​

get current SUPPLY_TOKEN lending rate_ at Liquidity

solidity
function supplyTokenLendingRate() public view returns (uint256 rate_);

_calcBorrowRates ​

calculates current borrow rates at kinks for supply rate and current rate data

solidity
function _calcBorrowRates(uint256 supplyRate_, uint256 rateConfig_)
    internal
    view
    returns (uint256 rateKink1_, uint256 rateKink2_);

_percentDiffForValue ​

gets the percentage difference between oldValue_ and newValue_ in relation to oldValue_

solidity
function _percentDiffForValue(uint256 oldValue_, uint256 newValue_)
    internal
    pure
    returns (uint256 configPercentDiff_);

_rebalanceRateV1 ​

rebalances for a RateV1 config

solidity
function _rebalanceRateV1(uint256 supplyRate_, uint256 rateConfig_) internal;

_rebalanceRateV2 ​

rebalances for a RateV2 config

solidity
function _rebalanceRateV2(uint256 supplyRate_, uint256 rateConfig_) internal;