IFluidLiquidityAdmin
updateAuths
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
Name | Type | Description |
---|---|---|
authsStatus_ | struct Structs.AddressBool | array of structs setting allowed status for an address. status true => add auth, false => remove auth |
updateGuardians
function updateGuardians(struct Structs.AddressBool[] guardiansStatus_) external
adds/removes guardians. Only callable by Governance.
Parameters
Name | Type | Description |
---|---|---|
guardiansStatus_ | struct Structs.AddressBool | array of structs setting allowed status for an address. status true => add guardian, false => remove guardian |
updateRevenueCollector
function updateRevenueCollector(address revenueCollector_) external
changes the revenue collector address (contract that is sent revenue). Only callable by Governance.
Parameters
Name | Type | Description |
---|---|---|
revenueCollector_ | address | new revenue collector address |
changeStatus
function changeStatus(uint256 newStatus_) external
changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.
Parameters
Name | Type | Description |
---|---|---|
newStatus_ | uint256 | new status status = 2 -> pause, status = 1 -> resume. |
updateRateDataV1s
function updateRateDataV1s(struct Structs.RateDataV1Params[] tokensRateData_) external
update tokens rate data version 1. Only callable by Auths.
Parameters
Name | Type | Description |
---|---|---|
tokensRateData_ | struct Structs.RateDataV1Params | array of RateDataV1Params with rate data to set for each token |
updateRateDataV2s
function updateRateDataV2s(struct Structs.RateDataV2Params[] tokensRateData_) external
update tokens rate data version 2. Only callable by Auths.
Parameters
Name | Type | Description |
---|---|---|
tokensRateData_ | struct Structs.RateDataV2Params | array of RateDataV2Params with rate data to set for each token |
updateTokenConfigs
function updateTokenConfigs(struct Structs.TokenConfig[] tokenConfigs_) external
updates token configs: fee charge on borrowers interest & storage update utilization threshold. Only callable by Auths.
Parameters
Name | Type | Description |
---|---|---|
tokenConfigs_ | struct Structs.TokenConfig | contains token address, fee & utilization threshold |
updateUserClasses
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
Name | Type | Description |
---|---|---|
userClasses_ | struct Structs.AddressUint256 | struct array of uint256 value to assign for each user address |
updateUserSupplyConfigs
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
Name | Type | Description |
---|---|---|
userSupplyConfigs_ | struct Structs.UserSupplyConfig | struct array containing user supply config, see UserSupplyConfig struct for more info |
updateUserBorrowConfigs
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
Name | Type | Description |
---|---|---|
userBorrowConfigs_ | struct Structs.UserBorrowConfig | struct array containing user borrow config, see UserBorrowConfig struct for more info |
pauseUser
function pauseUser(address user_, address[] supplyTokens_, address[] borrowTokens_) external
pause operations for a particular user in class 0 (class 1 users can't be paused by guardians). Only callable by Guardians.
Parameters
Name | Type | Description |
---|---|---|
user_ | address | address of user to pause operations for |
supplyTokens_ | address | token addresses to pause withdrawals for |
borrowTokens_ | address | token addresses to pause borrowings for |
unpauseUser
function unpauseUser(address user_, address[] supplyTokens_, address[] borrowTokens_) external
unpause operations for a particular user in class 0 (class 1 users can't be paused by guardians). Only callable by Guardians.
Parameters
Name | Type | Description |
---|---|---|
user_ | address | address of user to unpause operations for |
supplyTokens_ | address | token addresses to unpause withdrawals for |
borrowTokens_ | address | token addresses to unpause borrowings for |
collectRevenue
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
Name | Type | Description |
---|---|---|
tokens_ | address | array of tokens to collect revenue for |
updateExchangePrices
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
Name | Type | Description |
---|---|---|
tokens_ | address | tokens to update exchange prices for |
Return Values
Name | Type | Description |
---|---|---|
supplyExchangePrices_ | uint256 | new supply rates of overall system for each token |
borrowExchangePrices_ | uint256 | new borrow rates of overall system for each token |
IFluidLiquidityLogic
operate
function operate(address token_, int256 supplyAmount_, int256 borrowAmount_, address withdrawTo_, address borrowTo_, bytes callbackData_) external payable returns (uint256 memVar3_, uint256 memVar4_)
Single function which handles supply, withdraw, borrow & payback
_to trigger skipping in / out transfers when in&out amounts balance themselves out (gas optimization):
- supply(+) == borrow(+), withdraw(-) == payback(-).
withdrawTo_
/borrowTo_
must be msg.sender (protocol)callbackData_
MUST be encoded so that "from" address is at last 20 bytes (if this optimization is desired), also for native token operations where liquidityCallback is not triggered! from address must come at last position if there is more data. I.e. encode like: abi.encode(otherVar1, otherVar2, FROMADDRESS). Note dynamic types used with abi.encode come at the end so if dynamic types are needed, you must use abi.encodePacked to ensure the from address is at the end.
Parameters
Name | Type | Description |
---|---|---|
token_ | address | address of token (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native) |
supplyAmount_ | int256 | if +ve then supply, if -ve then withdraw, if 0 then nothing |
borrowAmount_ | int256 | if +ve then borrow, if -ve then payback, if 0 then nothing |
withdrawTo_ | address | if withdrawal then to which address |
borrowTo_ | address | if borrow then to which address |
callbackData_ | bytes | callback data passed to liquidityCallback method of protocol |
Return Values
Name | Type | Description |
---|---|---|
memVar3_ | uint256 | updated supplyExchangePrice |
memVar4_ | uint256 | updated borrowExchangePrice |