Skip to content

AdminModuleConstants ​

NATIVE_TOKEN_MAX_BORROW_LIMIT_CAP ​

solidity
uint256 NATIVE_TOKEN_MAX_BORROW_LIMIT_CAP

hard cap value for max borrow limit, used as sanity check. Usually 10x of total supply.

constructor ​

solidity
constructor(uint256 nativeTokenMaxBorrowLimitCap_) internal

GovernanceModule ​

Fluid Liquidity Governance only related methods

onlyGovernance ​

solidity
modifier onlyGovernance()

only governance guard

_checkValidAddress ​

solidity
function _checkValidAddress(address value_) internal pure

_checks that value_ is a valid address (not zero address)_

_checkIsContract ​

solidity
function _checkIsContract(address value_) internal view

_checks that value_ address is a contract_

_checkIsContractOrNativeAddress ​

solidity
function _checkIsContractOrNativeAddress(address value_) internal view

_checks that value_ address is a contract (which includes address zero check) or the native token_

_checkTokenDecimalsRange ​

solidity
function _checkTokenDecimalsRange(address token_) internal view

_checks that token_decimals are betweenMIN*TOKEN_DECIMALSandMAX_TOKEN_DECIMALS (inclusive).*

updateAuths ​

solidity
function updateAuths(struct Structs.AddressBool[] authsStatus_) external

adds/removes auths. Auths generally could be contracts which can have restricted actions defined on contract. auths can be helpful in reducing governance overhead where it's not needed.

Parameters ​

NameTypeDescription
authsStatus_struct Structs.AddressBool[]array of structs setting allowed status for an address. status true => add auth, false => remove auth

updateGuardians ​

solidity
function updateGuardians(struct Structs.AddressBool[] guardiansStatus_) external

adds/removes guardians. Only callable by Governance.

Parameters ​

NameTypeDescription
guardiansStatus_struct Structs.AddressBool[]array of structs setting allowed status for an address. status true => add guardian, false => remove guardian

updateRevenueCollector ​

solidity
function updateRevenueCollector(address revenueCollector_) external

changes the revenue collector address (contract that is sent revenue). Only callable by Governance.

Parameters ​

NameTypeDescription
revenueCollector_addressnew revenue collector address

AuthInternals ​

_computeRateDataPackedV1 ​

solidity
function _computeRateDataPackedV1(struct Structs.RateDataV1Params rataDataV1Params_) internal pure returns (uint256 rateData_)

computes rata data packed uint256 for version 1 rate input params telling desired values at different uzilitation points (0%, kink, 100%)

Parameters ​

NameTypeDescription
rataDataV1Params_struct Structs.RateDataV1Paramsrata data params for a given token

Return Values ​

NameTypeDescription
rateData_uint256packed uint256 rate data

_computeRateDataPackedV2 ​

solidity
function _computeRateDataPackedV2(struct Structs.RateDataV2Params rataDataV2Params_) internal pure returns (uint256 rateData_)

computes rata data packed uint256 for rate version 2 input params telling desired values at different uzilitation points (0%, kink1, kink2, 100%)

Parameters ​

NameTypeDescription
rataDataV2Params_struct Structs.RateDataV2Paramsrata data params for a given token

Return Values ​

NameTypeDescription
rateData_uint256packed uint256 rate data

_updateExchangePrices ​

solidity
function _updateExchangePrices(address token_) internal returns (uint256 supplyExchangePrice_, uint256 borrowExchangePrice_)

updates the exchange prices in storage for token_and returnssupplyExchangePrice*andborrowExchangePrice*. Recommended to use only in a method that later calls _updateExchangePricesAndRates().

_updateExchangePricesAndRates ​

solidity
function _updateExchangePricesAndRates(address token_) internal returns (uint256 supplyExchangePrice_, uint256 borrowExchangePrice_)

_updates the exchange prices + rates in storage for token_and returnssupplyExchangePrice*andborrowExchangePrice*_

AuthModule ​

Fluid Liquidity Auths only related methods

onlyAuths ​

solidity
modifier onlyAuths()

only auths guard

collectRevenue ​

solidity
function collectRevenue(address[] tokens_) external

collects revenue for tokens to configured revenueCollector address.

Note that this can revert if token balance is < revenueAmount (utilization > 100%)

Parameters ​

NameTypeDescription
tokens_address[]array of tokens to collect revenue for

changeStatus ​

solidity
function changeStatus(uint256 newStatus_) external

changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.

Parameters ​

NameTypeDescription
newStatus_uint256new status status = 2 -> pause, status = 1 -> resume.

updateRateDataV1s ​

solidity
function updateRateDataV1s(struct Structs.RateDataV1Params[] tokensRateData_) external

update tokens rate data version 1. Only callable by Auths.

Parameters ​

NameTypeDescription
tokensRateData_struct Structs.RateDataV1Params[]array of RateDataV1Params with rate data to set for each token

updateRateDataV2s ​

solidity
function updateRateDataV2s(struct Structs.RateDataV2Params[] tokensRateData_) external

update tokens rate data version 2. Only callable by Auths.

Parameters ​

NameTypeDescription
tokensRateData_struct Structs.RateDataV2Params[]array of RateDataV2Params with rate data to set for each token

updateTokenConfigs ​

solidity
function updateTokenConfigs(struct Structs.TokenConfig[] tokenConfigs_) external

updates token configs: fee charge on borrowers interest & storage update utilization threshold. Only callable by Auths.

Parameters ​

NameTypeDescription
tokenConfigs_struct Structs.TokenConfig[]contains token address, fee & utilization threshold

updateUserClasses ​

solidity
function updateUserClasses(struct Structs.AddressUint256[] userClasses_) external

updates user classes: 0 is for new protocols, 1 is for established protocols. Only callable by Auths.

Parameters ​

NameTypeDescription
userClasses_struct Structs.AddressUint256[]struct array of uint256 value to assign for each user address

updateUserWithdrawalLimit ​

solidity
function updateUserWithdrawalLimit(address user_, address token_, 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
token_addresstoken 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).

updateUserSupplyConfigs ​

solidity
function updateUserSupplyConfigs(struct Structs.UserSupplyConfig[] userSupplyConfigs_) external

sets user supply configs per token basis. Eg: with interest or interest-free and automated limits. Only callable by Auths.

Parameters ​

NameTypeDescription
userSupplyConfigs_struct Structs.UserSupplyConfig[]struct array containing user supply config, see UserSupplyConfig struct for more info

updateUserBorrowConfigs ​

solidity
function updateUserBorrowConfigs(struct Structs.UserBorrowConfig[] userBorrowConfigs_) external

setting user borrow configs per token basis. Eg: with interest or interest-free and automated limits. Only callable by Auths.

Parameters ​

NameTypeDescription
userBorrowConfigs_struct Structs.UserBorrowConfig[]struct array containing user borrow config, see UserBorrowConfig struct for more info

GuardianModule ​

Fluid Liquidity Guardians only related methods

onlyGuardians ​

solidity
modifier onlyGuardians()

only guardians guard

pauseUser ​

solidity
function pauseUser(address user_, address[] supplyTokens_, address[] borrowTokens_) public

pause operations for a particular user in class 0 (class 1 users can't be paused by guardians). Only callable by Guardians.

Parameters ​

NameTypeDescription
user_addressaddress of user to pause operations for
supplyTokens_address[]token addresses to pause withdrawals for
borrowTokens_address[]token addresses to pause borrowings for

unpauseUser ​

solidity
function unpauseUser(address user_, address[] supplyTokens_, address[] borrowTokens_) public

unpause operations for a particular user in class 0 (class 1 users can't be paused by guardians). Only callable by Guardians.

Parameters ​

NameTypeDescription
user_addressaddress of user to unpause operations for
supplyTokens_address[]token addresses to unpause withdrawals for
borrowTokens_address[]token addresses to unpause borrowings for

FluidLiquidityAdminModule ​

Fluid Liquidity auth protected methods to configure things such as: guardians, auths, governance, revenue, token configs, allowances etc. Accessibility of methods is restricted to Governance, Auths or Guardians. Governance is Auth & Governance by default

constructor ​

solidity
constructor(uint256 nativeTokenMaxBorrowLimitCap_) public

updateExchangePrices ​

solidity
function updateExchangePrices(address[] tokens_) external returns (uint256[] supplyExchangePrices_, uint256[] borrowExchangePrices_)

gets the current updated exchange prices for n tokens and updates all prices, rates related data in storage.

Parameters ​

NameTypeDescription
tokens_address[]tokens to update exchange prices for

Return Values ​

NameTypeDescription
supplyExchangePrices_uint256[]new supply rates of overall system for each token
borrowExchangePrices_uint256[]new borrow rates of overall system for each token