Fintroller
Introduction
The Fintroller is the administrator of the Hifi protocol. It can set the value of important variables like the liquidation incentive and can toggle on and off the operations that are allowed to be performed on fyTokens.
Gas Costs
Action
Typical Gas Cost
List Bond
<80K
Set Bond Collateralization Ratio
<40K
Set Bond Debt Ceiling
<50K
Set Borrow Allowed
<30K
Set Liquidate Borrow Allowed
<30K
Set Liquidation Incentive
<30K
Set Oracle
<50K
Set Redeem FyTokens Allowed
<30K
Set Repay Borrow Allowed
<30K
Set Supply Underlying Allowed
<30K
Storage Properties
Liquidation Incentive Mantissa
Multiplier representing the discount on collateral that a liquidator receives.
Oracle
The contract that provides price data for the collateral and the underlying asset.
Oracle Price Precision Scalar
The ratio between mantissa precision (1e18) and the oracle price precision (1e6).
Constant Functions
Get Bond
Reads all the storage properties of a bond struct.
fyToken
: The address of the bond contract.
It is not an error to provide an invalid fyToken address. The returned values would all be zero.
Solidity
Ethers.js
Get Bond Collateralization Ratio
Reads the collateralization ratio of the given bond.
fyToken
: The address of the bond contract.
It is not an error to provide an invalid fyToken address.
Solidity
Ethers.js
Get Bond Debt Ceiling
Reads the debt ceiling of the given bond.
fyToken
: The address of the bond contract.
It is not an error to provide an invalid fyToken address.
Solidity
Ethers.js
Get Borrow Allowed
Checks if the account should be allowed to borrow fyTokens.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Get Deposit Collateral Allowed
Checks if the account should be allowed to deposit collateral.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Get Liquidate Borrow Allowed
Checks if the account should be allowed to liquidate fyToken borrows.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Get Redeem FyTokens Allowed
Checks if the account should be allowed to redeem the underlying asset from the RedemptionPool.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Get Repay Borrow Allowed
Checks if the account should be allowed to repay borrows.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Get Supply Underlying Allowed
Checks if the account should be allowed to the supply underlying asset to the RedemptionPool.
fyToken
: The bond to make the check against.
Requirements:
The bond must be listed.
Solidity
Ethers.js
Non-Constant Functions
List Bond
Marks the bond as listed in this Fintroller's registry. Emits a "ListBond" event.
fyToken
: The fyToken contract to list.RETURN
: true = success, otherwise it reverts.
It is not an error to list a bond twice.
Requirements:
The caller must be the admin.
The fyToken must pass the inspection.
Set Bond Collateralization Ratio
Updates the bond's collateralization ratio. Emits a "SeBondCollateralizationRatio" event.
fyToken
: The bond for which to update the collateralization ratio.newCollateralizationRatioMantissa
: The new collateralization ratio as a mantissa.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
The new collateralization ratio cannot be higher than the maximum collateralization ratio.
The new collateralization ratio cannot be lower than the minimum collateralization ratio.
Set Bond Debt Ceiling
Updates the debt ceiling, which limits how much debt can be created in the bond market. Emits a "SetBondDebtCeiling" event.
fyToken
: The bond for which to update the debt ceiling.newDebtCeiling
: The uint256 value of the new debt ceiling, specified in the bond's decimal system.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
The debt ceiling cannot be zero.
The debt ceiling cannot fall below the current total supply of fyTokens.
Set Borrow Allowed
Updates the state of the permission accessed by the fyToken before a borrow. Emits a "SetBorrowAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
Set Deposit Collateral Allowed
Updates the state of the permission accessed by the fyToken before a collateral deposit. Emits a "SetDepositCollateralAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Set Liquidate Borrow Allowed
Updates the state of the permission accessed by the fyToken before a liquidate borrow. Emits a "SetLiquidateBorrowAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
Set Liquidation Incentive
Sets a new value for the liquidation incentive, which is applicable to all listed bonds. Emits a "SetLiquidationIncentive" event.
newLiquidationIncentiveMantissa
: The new liquidation incentive as a mantissa.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The new liquidation incentive cannot be higher than the maximum liquidation incentive.
The new liquidation incentive cannot be lower than the minimum liquidation incentive.
Set Oracle
Updates the oracle contract's address saved in storage. Emits a "SetOracle" event.
newOracle
: The new oracle contract.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The new address cannot be the zero address.
Set Redeem FyTokens Allowed
Updates the state of the permission accessed by the RedemptionPool before a redemption of underlying. Emits a "SetRedeemFyTokensAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
Set Repay Borrow Allowed
Updates the state of the permission accessed by the fyToken before a repay borrow. Emits a "SetRepayBorrowAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
The bond must be listed.
Set Supply Underlying Allowed
Updates the state of the permission accessed by the "RedemptionPool" before a supply of underlying. Emits a "SetSupplyUnderlyingAllowed" event.
fyToken
: The fyToken contract to update the permission for.state
: The new state to put in storage.RETURN
: true = success, otherwise it reverts.
Requirements:
The caller must be the admin.
Last updated
Was this helpful?