Skip to content

FluidRangeAuthDex ​

Git Source

Inherits:Variables, Error, Events

Functions ​

validAddress ​

Validates that an address is not the zero address

solidity
modifier validAddress(address value_);

onlyMultisig ​

Validates that an address is the team multisig

solidity
modifier onlyMultisig();

constructor ​

solidity
constructor(address wstethEthDex_, address weethEthDex_);

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

This function can only be called by team multisig

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

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

This function can only be called by team multisig

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

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

This function can only be called by team multisig

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

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);