Skip to content

FluidLimitsAuthDex ​

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

setWithdrawalLimit ​

Sets the withdrawal limit for a specific user at a dex

This function can only be called by team multisig

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

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

setUserWithdrawLimit ​

Sets the user withdraw base limit at a specific dex for a user (vault) without restrictions. Can only be called by team multisig.

solidity
function setUserWithdrawLimit(address dex_, address user_, uint256 baseLimit_, bool skipMaxPercentChangeCheck_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
dex_addressThe address of the dex at which to set the user withdraw limit
user_addressThe address of the user for which to set the user withdraw limit
baseLimit_uint256The base limit for the user supply. Set to 0 to keep current value.
skipMaxPercentChangeCheck_boolallow full range of limit check. Keep to false by default to have additional human error check.

setUserBorrowLimits ​

Sets the user borrow limits at a specific dex for a user (vault), with time and max percent change restrictions. Can only be called by team multisig.

solidity
function setUserBorrowLimits(address dex_, address user_, uint256 baseLimit_, uint256 maxLimit_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
dex_addressThe address of the dex at which to set the user borrow limit
user_addressThe address of the user for which to set the user borrow limit
baseLimit_uint256The base limit for the user borrow. Set to 0 to keep current value.
maxLimit_uint256The max limit for the user borrow. Set to 0 to keep current value.

setMaxBorrowShares ​

Sets the max borrow shares of a DEX. To update max supply and max borrow shares at once within same coolDown, use setMaxShares.

This function can only be called by team multisig

solidity
function setMaxBorrowShares(address dex_, uint256 maxBorrowShares_, bool confirmLiquidityLimitsCoverCap_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
dex_addressThe address of the dex at which to set the max borrow shares
maxBorrowShares_uint256The max borrow shares.
confirmLiquidityLimitsCoverCap_boolReminder to manually confirm that the limits for the dex at liquidity layer cover the cap.

setMaxSupplyShares ​

Sets the max supply shares of a DEX. To update max supply and max borrow shares at once within same coolDown, use setMaxShares.

This function can only be called by team multisig

solidity
function setMaxSupplyShares(address dex_, uint256 maxSupplyShares_, bool confirmLiquidityLimitsCoverCap_)
    external
    onlyMultisig;

Parameters

NameTypeDescription
dex_addressThe address of the dex at which to set the max supply shares
maxSupplyShares_uint256The max supply shares.
confirmLiquidityLimitsCoverCap_boolReminder to manually confirm that the limits for the dex at liquidity layer cover the cap.

setMaxShares ​

Sets both max borrow shares and max supply shares of a DEX at once.

This function can only be called by team multisig

solidity
function setMaxShares(
    address dex_,
    uint256 maxSupplyShares_,
    uint256 maxBorrowShares_,
    bool confirmLiquidityLimitsCoverCap_
) external onlyMultisig;

Parameters

NameTypeDescription
dex_addressThe address of the dex at which to set the max shares
maxSupplyShares_uint256The max supply shares.
maxBorrowShares_uint256The max borrow shares.
confirmLiquidityLimitsCoverCap_boolReminder to manually confirm that the limits for the dex at liquidity layer cover the cap.

_validateSetDexShares ​

Validates parameters for setting DEX shares.

solidity
function _validateSetDexShares(address dex_, bool confirmLiquidityLimitsCoverCap_) internal;

_setMaxBorrowShares ​

Sets the max borrow shares for a DEX.

solidity
function _setMaxBorrowShares(address dex_, uint256 maxBorrowShares_) internal;

_setMaxSupplyShares ​

Sets the max supply shares for a DEX.

solidity
function _setMaxSupplyShares(address dex_, uint256 maxSupplyShares_) internal;

_validateWithinMaxPercentChange ​

Validates that the new limit is within the allowed max percent change.

solidity
function _validateWithinMaxPercentChange(uint256 oldLimit_, uint256 newLimit_) internal pure;

_validateLastUpdateTime ​

Validates that the cooldown period has passed since the last update.

solidity
function _validateLastUpdateTime(uint256 lastUpdateTime_) internal view;

getMaxBorrowShares ​

Get the max borrow shares of a DEX

solidity
function getMaxBorrowShares(address dex_) public view returns (uint256);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
<none>uint256The max borrow shares

getMaxSupplyShares ​

Get the max supply shares of a DEX

solidity
function getMaxSupplyShares(address dex_) public view returns (uint256);

Parameters

NameTypeDescription
dex_addressThe address of the DEX

Returns

NameTypeDescription
<none>uint256The max supply shares

getUserSupplyConfig ​

Returns the user supply config for a given dex and user.

solidity
function getUserSupplyConfig(address dex_, address user_)
    public
    view
    returns (AdminModuleStructs.UserSupplyConfig memory userSupplyConfigs_);

getUserBorrowConfig ​

Returns the user borrow config for a given dex and user.

solidity
function getUserBorrowConfig(address dex_, address user_)
    public
    view
    returns (AdminModuleStructs.UserBorrowConfig memory userBorrowConfigs_);