Skip to content

FluidRangeAuthDex ​

Git Source

Inherits:Variables, Error, Events, BasicValidations

Functions ​

onlyAuthLevelMid ​

solidity
modifier onlyAuthLevelMid() ;

constructor ​

solidity
constructor(address wstethEthDex_, address weethEthDex_, address authGate_) validAddress(authGate_);

getRanges ​

solidity
function getRanges(address dex_) public view returns (uint256 upperRangePercent_, uint256 lowerRangePercent_);

getThresholdConfig ​

solidity
function getThresholdConfig(address dex_)
    public
    view
    returns (uint256 upperThresholdPercent_, uint256 lowerThresholdPercent_, uint256 thresholdShiftTime_);

setRanges ​

Sets the upper and lower range for a dex Reverts if both ranges equal the current ones or either moves more than 30%.

solidity
function setRanges(address dex_, uint256 upperRangePercent_, uint256 lowerRangePercent_, uint256 shiftTime_)
    external
    onlyAuthLevelMid;

Parameters

NameTypeDescription
dex_addressThe address of the dex
upperRangePercent_uint256The new upper range to be set
lowerRangePercent_uint256The new lower range to be set
shiftTime_uint256

setRangesByPercentage ​

Sets the upper and lower range for a dex by percentage to change from current config Reverts if a delta exceeds 30% or the resulting ranges equal the current ones.

solidity
function setRangesByPercentage(
    address dex_,
    int256 newUpperRangePercentage_,
    int256 newLowerRangePercentage_,
    uint256 shiftTime_
) external onlyAuthLevelMid;

Parameters

NameTypeDescription
dex_addressThe address of the dex
newUpperRangePercentage_int256The new upper range percentage change, 10000 = 1%. Positive to increase, negative to decrease
newLowerRangePercentage_int256The new lower range percentage change, 10000 = 1%. Positive to increase, negative to decrease
shiftTime_uint256

setThresholdConfig ​

Sets the upper and lower threshold percent for a dex Reverts if nothing changes at the DEX's 0.1% threshold precision, a field moves more than 30%, or a threshold moves off 0 (switching threshold rebalancing on is left to governance or a DEX auth).

solidity
function setThresholdConfig(
    address dex_,
    uint256 upperThresholdPercent_,
    uint256 lowerThresholdPercent_,
    uint256 thresholdShiftTime_,
    uint256 shiftTime_
) external onlyAuthLevelMid;

Parameters

NameTypeDescription
dex_addressThe address of the dex
upperThresholdPercent_uint256The new upper threshold percent, 10000 = 1%
lowerThresholdPercent_uint256The new lower threshold percent, 10000 = 1%
thresholdShiftTime_uint256The new threshold shift time
shiftTime_uint256

_percentDiffForValue ​

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

_getNewRange ​

solidity
function _getNewRange(uint256 currentRange_, int256 newRangePercentage_) internal pure returns (uint256 newRange_);

_validatePercentChange ​

solidity
function _validatePercentChange(uint256 percent_) internal pure;

_validateChange ​

solidity
function _validateChange(uint256 oldConfig_, uint256 newConfig_) internal pure;

_validateShiftTime ​

solidity
function _validateShiftTime(address dex_, uint256 shiftTime_) internal view;

_validateLastUpdateTime ​

solidity
function _validateLastUpdateTime(address dex_, UpdateType updateType_) internal view;

_abs ​

solidity
function _abs(int256 value_) internal pure returns (uint256);