Skip to content

Structs ​

UserSupplyHistory ​

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

Events ​

LogRebalanceWithdrawalLimit ​

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

emitted when rebalancer successfully changes the withdrawal limit

LogSetWithdrawalLimit ​

solidity
event LogSetWithdrawalLimit(address user, address token, 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

LIQUIDITY ​

solidity
contract IFluidLiquidity LIQUIDITY

Variables ​

userData ​

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

FluidWithdrawLimitAuth ​

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 liquidity_, address multisig_) public

rebalanceWithdrawalLimit ​

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

updates the withdrawal limit for a specific token of a user in the liquidity

This function can only be called by the rebalancer

Parameters ​

NameTypeDescription
user_addressThe address of the user for which to set the withdrawal limit
token_addressThe address of the token for which to set the withdrawal limit
newLimit_uint256The new withdrawal limit to be set

setWithdrawalLimit ​

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

Sets the withdrawal limit for a specific token of a user in the liquidity

This function can only be called by team multisig

Parameters ​

NameTypeDescription
user_addressThe address of the user for which to set the withdrawal limit
token_addressThe address of the token for which to set the withdrawal limit
newLimit_uint256The new withdrawal limit to be set

getUsersData ​

solidity
function getUsersData(address[] users_, address[] tokens_) 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*_