Skip to content

Constants ​

RESERVE_CONTRACT ​

solidity
contract IFluidReserveContract RESERVE_CONTRACT

LIQUIDITY ​

solidity
contract IFluidLiquidity LIQUIDITY

SUPPLY_TOKEN ​

solidity
address SUPPLY_TOKEN

supply token at Liquidity which borrow rate is based on

BORROW_TOKEN ​

solidity
address BORROW_TOKEN

borrow token at Liquidity for which the borrow rate is managed

RATE_BUFFER_KINK1 ​

solidity
int256 RATE_BUFFER_KINK1

buffer at kink1 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)

RATE_BUFFER_KINK2 ​

solidity
int256 RATE_BUFFER_KINK2

buffer at kink2 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)

only used if CURRENT borrow rate mode at Liquidity is V2 (with 2 kinks).

MIN_UPDATE_DIFF ​

solidity
uint256 MIN_UPDATE_DIFF

minimum percent difference to trigger an update. In percent (100 = 1%, 1 = 0.01%)

_LIQUDITY_SUPPLY_TOTAL_AMOUNTS_SLOT ​

solidity
bytes32 _LIQUDITY_SUPPLY_TOTAL_AMOUNTS_SLOT

_LIQUDITY_SUPPLY_EXCHANGE_PRICES_AND_CONFIG_SLOT ​

solidity
bytes32 _LIQUDITY_SUPPLY_EXCHANGE_PRICES_AND_CONFIG_SLOT

_LIQUDITY_BORROW_RATE_DATA_SLOT ​

solidity
bytes32 _LIQUDITY_BORROW_RATE_DATA_SLOT

EXCHANGE_PRICES_PRECISION ​

solidity
uint256 EXCHANGE_PRICES_PRECISION

DEFAULT_EXPONENT_SIZE ​

solidity
uint256 DEFAULT_EXPONENT_SIZE

DEFAULT_EXPONENT_MASK ​

solidity
uint256 DEFAULT_EXPONENT_MASK

X14 ​

solidity
uint256 X14

X16 ​

solidity
uint256 X16

X64 ​

solidity
uint256 X64

FOUR_DECIMALS ​

solidity
uint256 FOUR_DECIMALS

Events ​

LogUpdateRate ​

solidity
event LogUpdateRate(uint256 supplyRate, uint256 oldRateKink1, uint256 newRateKink1, uint256 oldRateKink2, uint256 newRateKink2)

emitted when borrow rate for BORROW_TOKEN is updated based on supply rate of SUPPLY_TOKEN + buffer.

FluidBufferRateHandler ​

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

validAddress ​

solidity
modifier validAddress(address value_)

Validates that an address is not the zero address

onlyRebalancer ​

solidity
modifier onlyRebalancer()

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

constructor ​

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

configPercentDiff ​

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

returns how much the new config would be different from current config in percent (100 = 1%, 1 = 0.01%).

rebalance ​

solidity
function rebalance() external

Rebalances the configs at Fluid Liquidity based on config handler target. Reverts if no update is needed. Can only be called by an authorized rebalancer.

calcBorrowRates ​

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

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

supplyTokenLendingRate ​

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

get current SUPPLY_TOKEN lending rate_ at Liquidity

_calcBorrowRates ​

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

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

_percentDiffForValue ​

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

_gets the percentage difference between oldValue_andnewValue*in relation tooldValue*_

_rebalanceRateV1 ​

solidity
function _rebalanceRateV1(uint256 supplyRate_, uint256 rateConfig_) internal

rebalances for a RateV1 config

_rebalanceRateV2 ​

solidity
function _rebalanceRateV2(uint256 supplyRate_, uint256 rateConfig_) internal

rebalances for a RateV2 config