IOperator

Git Source

Functions

userWhitelisted

Returns true/false for user

function userWhitelisted(address _user) external view returns (bool);

isOperator

Should return true

function isOperator() external view returns (bool);

limitPerTimePeriod

Should return outflow limit

function limitPerTimePeriod() external view returns (uint256);

cumulativeOutflowVolume

Should return outflow volume

function cumulativeOutflowVolume() external view returns (uint256);

lastOutflowResetTimestamp

Should return last reset time for outflow check

function lastOutflowResetTimestamp() external view returns (uint256);

outflowResetTimeWindow

Should return the outflow volume time window

function outflowResetTimeWindow() external view returns (uint256);

isPaused

Returns if operation is paused

function isPaused(address mToken, ImTokenOperationTypes.OperationType _type) external view returns (bool);

Parameters

NameTypeDescription
mTokenaddressThe mToken to check
_typeImTokenOperationTypes.OperationTypethe operation type

rolesOperator

Roles

function rolesOperator() external view returns (IRoles);

blacklistOperator

Blacklist

function blacklistOperator() external view returns (IBlacklister);

oracleOperator

Oracle which gives the price of any given asset

function oracleOperator() external view returns (address);

closeFactorMantissa

Multiplier used to calculate the maximum repayAmount when liquidating a borrow

function closeFactorMantissa() external view returns (uint256);

liquidationIncentiveMantissa

Multiplier representing the discount on collateral that a liquidator receives

function liquidationIncentiveMantissa(address market) external view returns (uint256);

isMarketListed

Returns true/false

function isMarketListed(address market) external view returns (bool);

getAssetsIn

Returns the assets an account has entered

function getAssetsIn(address _user) external view returns (address[] memory mTokens);

Parameters

NameTypeDescription
_useraddressThe address of the account to pull assets for

Returns

NameTypeDescription
mTokensaddress[]A dynamic list with the assets the account has entered

getAllMarkets

A list of all markets

function getAllMarkets() external view returns (address[] memory mTokens);

borrowCaps

Borrow caps enforced by borrowAllowed for each mToken address. Defaults to zero which corresponds to unlimited borrowing.

function borrowCaps(address _mToken) external view returns (uint256);

supplyCaps

Supply caps enforced by supplyAllowed for each mToken address. Defaults to zero which corresponds to unlimited supplying.

function supplyCaps(address _mToken) external view returns (uint256);

rewardDistributor

Reward Distributor to markets supply and borrow (including protocol token)

function rewardDistributor() external view returns (address);

checkMembership

Returns whether the given account is entered in the given asset

function checkMembership(address account, address mToken) external view returns (bool);

Parameters

NameTypeDescription
accountaddressThe address of the account to check
mTokenaddressThe mToken to check

Returns

NameTypeDescription
<none>boolTrue if the account is in the asset, otherwise false.

getAccountLiquidity

Determine the current account liquidity wrt collateral requirements

function getAccountLiquidity(address account) external view returns (uint256, uint256);

Returns

NameTypeDescription
<none>uint256account liquidity in excess of collateral requirements, account shortfall below collateral requirements)
<none>uint256

getHypotheticalAccountLiquidity

Determine what the account liquidity would be if the given amounts were redeemed/borrowed

function getHypotheticalAccountLiquidity(
    address account,
    address mTokenModify,
    uint256 redeemTokens,
    uint256 borrowAmount
) external view returns (uint256, uint256);

Parameters

NameTypeDescription
accountaddressThe account to determine liquidity for
mTokenModifyaddressThe market to hypothetically redeem/borrow in
redeemTokensuint256The number of tokens to hypothetically redeem
borrowAmountuint256The amount of underlying to hypothetically borrow

Returns

NameTypeDescription
<none>uint256hypothetical account liquidity in excess of collateral requirements, hypothetical account shortfall below collateral requirements)
<none>uint256

getUSDValueForAllMarkets

Returns USD value for all markets

function getUSDValueForAllMarkets() external view returns (uint256);

liquidateCalculateSeizeTokens

Calculate number of tokens of collateral asset to seize given an underlying amount

Used in liquidation (called in mTokenBorrowed.liquidate)

function liquidateCalculateSeizeTokens(address mTokenBorrowed, address mTokenCollateral, uint256 actualRepayAmount)
    external
    view
    returns (uint256);

Parameters

NameTypeDescription
mTokenBorrowedaddressThe address of the borrowed mToken
mTokenCollateraladdressThe address of the collateral mToken
actualRepayAmountuint256The amount of mTokenBorrowed underlying to convert into mTokenCollateral tokens

Returns

NameTypeDescription
<none>uint256number of mTokenCollateral tokens to be seized in a liquidation

isDeprecated

Returns true if the given mToken market has been deprecated

All borrows in a deprecated mToken market can be immediately liquidated

function isDeprecated(address mToken) external view returns (bool);

Parameters

NameTypeDescription
mTokenaddressThe market to check if deprecated

setPaused

Set pause for a specific operation

function setPaused(address mToken, ImTokenOperationTypes.OperationType _type, bool state) external;

Parameters

NameTypeDescription
mTokenaddressThe market token address
_typeImTokenOperationTypes.OperationTypeThe pause operation type
stateboolThe pause operation status

enterMarkets

Add assets to be included in account liquidity calculation

function enterMarkets(address[] calldata _mTokens) external;

Parameters

NameTypeDescription
_mTokensaddress[]The list of addresses of the mToken markets to be enabled

enterMarketsWithSender

Add asset (msg.sender) to be included in account liquidity calculation

function enterMarketsWithSender(address _account) external;

Parameters

NameTypeDescription
_accountaddressThe account to add for

exitMarket

Removes asset from sender's account liquidity calculation

Sender must not have an outstanding borrow balance in the asset, or be providing necessary collateral for an outstanding borrow.

function exitMarket(address _mToken) external;

Parameters

NameTypeDescription
_mTokenaddressThe address of the asset to be removed

claimMalda

Claim all the MALDA accrued by holder in all markets

function claimMalda(address holder) external;

Parameters

NameTypeDescription
holderaddressThe address to claim MALDA for

claimMalda

Claim all the MALDA accrued by holder in the specified markets

function claimMalda(address holder, address[] memory mTokens) external;

Parameters

NameTypeDescription
holderaddressThe address to claim MALDA for
mTokensaddress[]The list of markets to claim MALDA in

claimMalda

Claim all MALDA accrued by the holders

function claimMalda(address[] memory holders, address[] memory mTokens, bool borrowers, bool suppliers) external;

Parameters

NameTypeDescription
holdersaddress[]The addresses to claim MALDA for
mTokensaddress[]The list of markets to claim MALDA in
borrowersboolWhether or not to claim MALDA earned by borrowing
suppliersboolWhether or not to claim MALDA earned by supplying