FluidLimitsAuthDex ​
Inherits:Variables, Error, Events, BasicValidations
Functions ​
onlyAuthLevelMid ​
modifier onlyAuthLevelMid() ;constructor ​
constructor(address authGate_) validAddress(authGate_);setWithdrawalLimit ​
Sets the withdrawal limit for a specific user at a dex
function setWithdrawalLimit(address dex_, address user_, uint256 newLimit_) external onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex |
user_ | address | The address of the user for which to set the withdrawal limit |
newLimit_ | uint256 | The 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.
function setUserWithdrawLimit(address dex_, address user_, uint256 baseLimit_, bool skipMaxPercentChangeCheck_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex at which to set the user withdraw limit |
user_ | address | The address of the user for which to set the user withdraw limit |
baseLimit_ | uint256 | The base limit for the user supply; must be non-zero. |
skipMaxPercentChangeCheck_ | bool | allow 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.
function setUserBorrowLimits(address dex_, address user_, uint256 baseLimit_, uint256 maxLimit_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex at which to set the user borrow limit |
user_ | address | The address of the user for which to set the user borrow limit |
baseLimit_ | uint256 | The base limit for the user borrow. Set to 0 to keep current value. |
maxLimit_ | uint256 | The 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.
function setMaxBorrowShares(address dex_, uint256 maxBorrowShares_, bool confirmLiquidityLimitsCoverCap_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex at which to set the max borrow shares |
maxBorrowShares_ | uint256 | The max borrow shares. |
confirmLiquidityLimitsCoverCap_ | bool | Reminder 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.
function setMaxSupplyShares(address dex_, uint256 maxSupplyShares_, bool confirmLiquidityLimitsCoverCap_)
external
onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex at which to set the max supply shares |
maxSupplyShares_ | uint256 | The max supply shares. |
confirmLiquidityLimitsCoverCap_ | bool | Reminder 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.
function setMaxShares(
address dex_,
uint256 maxSupplyShares_,
uint256 maxBorrowShares_,
bool confirmLiquidityLimitsCoverCap_
) external onlyAuthLevelMid;Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the dex at which to set the max shares |
maxSupplyShares_ | uint256 | The max supply shares. |
maxBorrowShares_ | uint256 | The max borrow shares. |
confirmLiquidityLimitsCoverCap_ | bool | Reminder to manually confirm that the limits for the dex at liquidity layer cover the cap. |
_validateSetDexShares ​
Validates parameters for setting DEX shares.
function _validateSetDexShares(address dex_, bool confirmLiquidityLimitsCoverCap_) internal;_setMaxBorrowShares ​
Sets the max borrow shares for a DEX.
function _setMaxBorrowShares(address dex_, uint256 maxBorrowShares_) internal;_setMaxSupplyShares ​
Sets the max supply shares for a DEX.
function _setMaxSupplyShares(address dex_, uint256 maxSupplyShares_) internal;_validateWithinMaxPercentChange ​
Validates that the new limit is within the allowed max percent change.
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.
function _isSidePaused(address dex_, address user_, uint256 mappingSlot_) internal view returns (bool);_validateLastUpdateTime ​
Validates that the cooldown period has passed since the last update.
function _validateLastUpdateTime(uint256 lastUpdateTime_) internal view;getMaxBorrowShares ​
Get the max borrow shares of a DEX
function getMaxBorrowShares(address dex_) public view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the DEX |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The max borrow shares |
getMaxSupplyShares ​
Get the max supply shares of a DEX
function getMaxSupplyShares(address dex_) public view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
dex_ | address | The address of the DEX |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The max supply shares |
getUserSupplyConfig ​
Returns the user supply config for a given dex and user.
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.
function getUserBorrowConfig(address dex_, address user_)
public
view
returns (AdminModuleStructs.UserBorrowConfig memory userBorrowConfigs_);