Skip to content

FluidLimitsAuthDex ​

Git Source

Inherits:Variables, Error, Events, BasicValidations

Functions ​

onlyAuthLevelMid ​

solidity
modifier onlyAuthLevelMid() ;

constructor ​

solidity
constructor(address authGate_) validAddress(authGate_);

setWithdrawalLimit ​

Sets the withdrawal limit for a specific user at a dex

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

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. updateUserSupplyConfigs force-re-enables the user's supply side on the pool, so if that side was paused it is re-paused within the same transaction, emitting LogRePauseUser.

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

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; must be non-zero.
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. updateUserBorrowConfigs force-re-enables the user's borrow side on the pool, so if that side was paused it is re-paused within the same transaction, emitting LogRePauseUser.

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

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.

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

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.

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

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.

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

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;

_isSidePaused ​

Reads bit 0 of the user's packed word at mappingSlot_ (supply or borrow) on dex_. A configured user has non-zero data, and bit 0 == 0 there means that whole side is paused.

solidity
function _isSidePaused(address dex_, address user_, uint256 mappingSlot_) internal view returns (bool);

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