Skip to content

IFluidDexT1Admin ​

updateUserWithdrawalLimit ​

solidity
function updateUserWithdrawalLimit(address user_, uint256 newLimit_) external

sets a new withdrawal limit as the current limit for a certain user

Parameters ​

NameTypeDescription
user_addressuser address for which to update the withdrawal limit
newLimit_uint256new limit until which user supply can decrease to. Important: input in raw. Must account for exchange price in input param calculation. Note any limit that is < max expansion or > current user supply will set max expansion limit or current user supply as limit respectively. - set 0 to make maximum possible withdrawable: instant full expansion, and if that goes below base limit then fully down to 0. - set type(uint256).max to make current withdrawable 0 (sets current user supply as limit).

Structs ​

UserSupplyHistory ​

solidity
struct UserSupplyHistory {
  uint40 initialDailyTimestamp;
  uint40 initialHourlyTimestamp;
  uint8 rebalancesIn1Hour;
  uint8 rebalancesIn24Hours;
  uint160 leastDailyUserSupply;
}

Events ​

LogRebalanceWithdrawalLimit ​

solidity
event LogRebalanceWithdrawalLimit(address dex, address user, uint256 newLimit)

emitted when rebalancer successfully changes the withdrawal limit

LogSetWithdrawalLimit ​

solidity
event LogSetWithdrawalLimit(address dex, address user, uint256 newLimit)

emitted when multisig successfully changes the withdrawal limit

Constants ​

X64 ​

solidity
uint256 X64

DEFAULT_EXPONENT_SIZE ​

solidity
uint256 DEFAULT_EXPONENT_SIZE

DEFAULT_EXPONENT_MASK ​

solidity
uint256 DEFAULT_EXPONENT_MASK

TEAM_MULTISIG ​

solidity
address TEAM_MULTISIG

RESERVE_CONTRACT ​

solidity
contract IFluidReserveContract RESERVE_CONTRACT

Variables ​

userData ​

solidity
mapping(address => struct Structs.UserSupplyHistory) userData

FluidWithdrawLimitAuthDex ​

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)

onlyMultisig ​

solidity
modifier onlyMultisig()

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

constructor ​

solidity
constructor(contract IFluidReserveContract reserveContract_, address multisig_) public

rebalanceWithdrawalLimit ​

solidity
function rebalanceWithdrawalLimit(address dex_, address user_, uint256 newLimit_) external

updates the withdrawal limit for a specific user at a dex

This function can only be called by the rebalancer

Parameters ​

NameTypeDescription
dex_addressThe address of the dex
user_addressThe address of the user for which to set the withdrawal limit
newLimit_uint256The new withdrawal limit to be set

setWithdrawalLimit ​

solidity
function setWithdrawalLimit(address dex_, address user_, uint256 newLimit_) external

Sets the withdrawal limit for a specific user at a dex

This function can only be called by team multisig

Parameters ​

NameTypeDescription
dex_addressThe address of the dex
user_addressThe address of the user for which to set the withdrawal limit
newLimit_uint256The new withdrawal limit to be set

getUsersData ​

solidity
function getUsersData(address dex_, address[] users_) public view returns (uint256[] initialUsersSupply_, uint256[] initialWithdrawLimit_)

_percentDiffForValue ​

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

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