Comptroller
The sdk instance used by the comptroller.
The raw web3 contract instance for the comptroller.
Contract address of the comptroller.
Type:
string
Change the unitroller for the comptroller implementation.
Parameters:
unitroller: string
- The new unitroller's address.
Returns whether borrow guardian is paused.
Parameters:
Returns:
Promise<boolean>
Returns whether mint guardian is paused.
Parameters:
Returns:
Promise<boolean>
Sets the borrowing status for a cToken.
Parameters:
state: boolean
- Whether borrowing should be paused
Sets the close factor used when liquidating borrows.
Parameters:
newCloseFactorMantissa: number | string | BN
- New close factor, scaled by 1e18.
Sets the collateral factor for a market.
Parameters:
newCollateralFactorMantissa: number | string | BN
- The new collateral factor, scaled by 1e18.
Sets liquidation incentive.
Parameters:
newLiquidationIncentiveMantissa: number | string | BN
- New liquidationIncentive scaled by 1e18
Sets maxAssets which controls how many markets can be entered.
Parameters:
newMaxAssets: number | string | BN
- New max assets.
Sets the mint status for a cToken.
Parameters:
state: boolean
- Whether minting should be paused for cToken.
Admin function to change the Pause Guardian.
Parameters:
newPauseGuardian: string
- The address of the new Pause Guardian.
Sets a new price oracle for the comptroller
.
Parameters:
newOracle: string
- New price oracle to use.
Change the seize status for the comptroller.
Parameters:
state: boolean
- True for pause.
Parameters:
state: boolean
- True for pause.
Sets the whitelist enforcement for the comptroller
.
Parameters:
enforce: boolean
- Whether to enforce the whitelist.
Sets the whitelist
statuses
for suppliers.
Parameters:
suppliers: string[]
- Array of supplies to update the statuses of.statuses: boolean[]
- New statuses for the suppliers.
Add the market to the markets mapping and set it as listed.
Parameters:
Add the market to the markets mapping and set it as listed and set the collateral factor
.
Parameters:
newCollateralFactorMantissa: number | string | BN
- The new collateral factor, scaled by 1e18.
Removed a market from the markets mapping and sets it as unlisted
.
Parameters:
Per-account mapping of "assets you are in", capped by maxAssets.
Parameters:
account: string
-cTokenIndex: number | string | BN
-
Returns:
Promise<string>
Returns the contract admin.
Parameters:
Returns:
Promise<string>
Returns whether or not the admin has admin rights.
Parameters:
Returns:
Promise<boolean>
A list of all borrowers who have entered markets.
Parameters:
index: number | string | BN
- Borrower index.
Returns:
Promise<string>
Returns a CToken address based on the index.
Parameters:
index: number | string | BN
- Index of the market to fetch.
Returns:
Promise<string>
Checks if the account should be allowed to borrow the underlying asset of the given market
.
Parameters:
borrower: string
- The account which would borrow the asset.borrowAmount: number | string | BN
- The amount of underlying the account would borrow.
Returns whether borrow guardian is paused for the cToken or not.
Parameters:
Returns:
Promise<boolean>
Validates borrow and reverts on rejection. May emit logs.
Parameters:
borrower: string
- The address borrowing the underlying.borrowAmount: nnumber | string | BN
- The amount of the underlying asset requested to borrow.
Checks if the account should be allowed to borrow the underlying asset of the given market.
Parameters:
accountBorrowNew: number | string | BN
- The user's new borrow balance of the underlying asset.
Parameters:
underlying: string
-
Returns:
Promise<string>
Returns whether the given account is entered in the given asset.
Parameters:
account: string
- The address of the account to check.
Returns the close factor mantissa for the pool.
Parameters:
Returns:
Promise<string>
Returns the comptroller implementation address for the unitroller.
Parameters:
Returns:
Promise<string>
Returns whether or not the supplier whitelist is enforced.
Parameters:
Returns:
Promise<boolean>
Add assets to be included in account liquidity calculation.
Parameters:
Removes asset from sender's account liquidity calculation
.
Parameters:
Returns whether or not the Fuse admin has admin rights.
Parameters:
Returns the current account liquidity wrt collateral requirements.
Parameters:
account: string
- The account to return the liquidity for.
Returns:
Promise<[string, string, string]>
Return all of the borrowers.
Parameters:
Returns:
Promise<string[]>
Return all of the markets.
Parameters:
Returns:
Promise<string[]>
Returns the assets an account has entered.
Parameters:
account: string
- The address of the account to pull assets for.
Returns:
Promise<string[]>
Determine what the account liquidity would be if the given amounts were redeemed/borrowed.
Parameters:
account: string
- The account to determine liquidity for.redeemTokens: number | string | BN
- The number of tokens to hypothetically redeem.borrowAmount: number | string | BN
- The amount of underlying to hypothetically borrow.
Returns:
Promise<[string, string, string]>
Determine the maximum borrow amount of a cToken.
Parameters:
account: string
- The account to determine liquidity for.
Returns:
Promise<[string, string]>
Determine the maximum redeem amount of a cToken.
Parameters:
account: string
- The account to determine liquidity for.
Returns:
Promise<[string, string]>
Return all of the whitelist.
Parameters:
Returns:
Promise<string[]>
Parameters:
Returns:
Promise<boolean>
Checks if the liquidation should be allowed to occur.
Parameters:
liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower,repayAmount: number | string | BN
- The amount of underlying being repaid.
Parameters:
liquidator: string
- The address repaying the borrow and seizing the collateral.borrower: string
- The address of the borrower.actualRepayAmount: number | string | BN
- The amount of underlying being repaid.seizeTokens: number | string | BN
-
Calculate number of tokens of collateral asset to seize given an underlying amount.
Parameters:
accountRepayAmount: number | string | BN
- The amount of cTokenBorrowed underlying to convert into cTokenCollateral tokens.
Returns the liquidation incentive mantissa.
Parameters:
Returns:
Promise<string>
M
apping of cTokens -> Market metadataParameters:
Returns:
Promise<{
isListed: boolean;
collateralFactorMantissa: string
}>
Returns the max number of assets a single account can participate in (borrow or use as collateral).
Parameters:
Returns:
Promise<string>
Checks if the account should be allowed to mint tokens in the given market.
Parameters:
minter: string
- The account which would get the minted tokens.mintAmount: number | string | BN
- The amount of underlying being supplied to the market in exchange for tokens.
Returns whether the mint guardian is paused for a market.
Parameters:
Returns:
Promise<boolean>
Validates mint and reverts on rejection.
Parameters:
minter: string
- The address minting the tokens.actualMintAmount: number | string | BN
- The amount of the underlying asset being minted.mintTokens: number | string | BN
- The number of tokens being minted.
Checks if the account should be allowed to borrow the underlying asset of the given market.
Parameters:
minter: string
-actualMintAmount: number | string | BN
-mintTokens: number | string | BN
-
Returns the price oracle used by the comptroller.
Parameters:
Returns:
Promise<string>
Returns the current pause guardian.
Parameters:
Returns:
Promise<string>
Returns the pending admin for this contract.
Parameters:
Returns:
Promise<string>
Returns the pending comptroller implementation for the unitroller.
Parameters: