Overview
The ICreditConfiguratorV3 interface provides administrative functions for configuring credit managers in Gearbox Protocol V3. It handles collateral token management, adapter permissions, fee structures, and system upgrades.
View Functions
creditManager
function creditManager() external view returns (address)
Returns the address of the associated credit manager.
The credit manager contract address
creditFacade
function creditFacade() external view returns (address)
Returns the address of the associated credit facade.
The credit facade contract address
underlying
function underlying() external view returns (address)
Returns the address of the underlying asset for this credit manager.
The underlying token address
allowedAdapters
function allowedAdapters() external view returns (address[] memory)
Returns an array of all currently allowed adapter addresses.
Array of allowed adapter contract addresses
Token Management Functions
makeAllTokensQuoted
function makeAllTokensQuoted() external
Marks all collateral tokens in the credit manager as quoted tokens in the pool quota keeper.
addCollateralToken
function addCollateralToken(address token, uint16 liquidationThreshold) external
Adds a new token as recognizable collateral in the credit manager.
The address of the token to add as collateral
The liquidation threshold for the token (in basis points, max 10000)
setLiquidationThreshold
function setLiquidationThreshold(address token, uint16 liquidationThreshold) external
Sets a new liquidation threshold for a collateral token.
The address of the collateral token
The new liquidation threshold (in basis points, max 10000)
rampLiquidationThreshold
function rampLiquidationThreshold(
address token,
uint16 liquidationThresholdFinal,
uint40 rampStart,
uint24 rampDuration
) external
Schedules a gradual ramping of a token’s liquidation threshold over time.
The address of the collateral token
liquidationThresholdFinal
The final liquidation threshold after ramping completes
The timestamp when the ramping should start
The duration of the ramping period in seconds
forbidToken
function forbidToken(address token) external
Forbids a collateral token, preventing it from being enabled on new credit accounts.
The address of the token to forbid
allowToken
function allowToken(address token) external
Re-allows a previously forbidden collateral token.
The address of the token to allow
Adapter Management Functions
allowAdapter
function allowAdapter(address adapter) external
Allows a new adapter and its target contract in the credit manager.
The address of the adapter contract to allow
forbidAdapter
function forbidAdapter(address adapter) external
Forbids an adapter and its target contract in the credit manager.
The address of the adapter contract to forbid
Fee Configuration Functions
setFees
function setFees(
uint16 feeLiquidation,
uint16 liquidationPremium,
uint16 feeLiquidationExpired,
uint16 liquidationPremiumExpired
) external
Sets new fee parameters in the credit manager.
The fee charged on liquidations (in basis points)
The premium discount given to liquidators (in basis points)
The fee charged on expired account liquidations (in basis points)
liquidationPremiumExpired
The premium discount for expired account liquidations (in basis points)
Upgrade Functions
setPriceOracle
function setPriceOracle(address newPriceOracle) external
Sets a new price oracle for the credit manager.
The address of the new price oracle contract
Changing the price oracle is a critical operation that affects all collateral valuations.
setCreditFacade
function setCreditFacade(address newCreditFacade, bool migrateParams) external
Connects a new credit facade to the credit manager.
The address of the new credit facade contract
Whether to migrate parameters from the old facade to the new one
upgradeCreditConfigurator
function upgradeCreditConfigurator(address newCreditConfigurator) external
Upgrades the credit manager’s configurator contract to a new implementation.
The address of the new credit configurator contract
Credit Facade Configuration Functions
setDebtLimits
function setDebtLimits(uint128 newMinDebt, uint128 newMaxDebt) external
Sets new debt principal limits for the credit facade.
The minimum debt principal amount allowed
The maximum debt principal amount allowed
setMaxDebtPerBlockMultiplier
function setMaxDebtPerBlockMultiplier(uint8 newMaxDebtLimitPerBlockMultiplier) external
Sets the multiplier for maximum debt that can be borrowed per block.
newMaxDebtLimitPerBlockMultiplier
The new max debt per block multiplier
forbidBorrowing
function forbidBorrowing() external
Forbids new borrowing by setting max debt to 0, effectively pausing the credit facade.
setLossPolicy
function setLossPolicy(address newLossPolicy) external
Sets a new loss policy contract for handling bad debt.
The address of the new loss policy contract
setExpirationDate
function setExpirationDate(uint40 newExpirationDate) external
Sets a new expiration timestamp in the credit facade.
The new expiration timestamp (unix timestamp)
Events
Token Events
AddCollateralToken
event AddCollateralToken(address indexed token)
Emitted when a token is made recognizable as collateral in the credit manager.
The address of the added collateral token
SetTokenLiquidationThreshold
event SetTokenLiquidationThreshold(address indexed token, uint16 liquidationThreshold)
Emitted when a new collateral token liquidation threshold is set.
The address of the collateral token
The new liquidation threshold value
ScheduleTokenLiquidationThresholdRamp
event ScheduleTokenLiquidationThresholdRamp(
address indexed token,
uint16 liquidationThresholdInitial,
uint16 liquidationThresholdFinal,
uint40 timestampRampStart,
uint40 timestampRampEnd
)
Emitted when a collateral token liquidation threshold ramping is scheduled.
The address of the collateral token
liquidationThresholdInitial
The initial liquidation threshold at ramp start
liquidationThresholdFinal
The final liquidation threshold at ramp end
The timestamp when ramping starts
The timestamp when ramping ends
ForbidToken
event ForbidToken(address indexed token)
Emitted when a collateral token is forbidden.
The address of the forbidden token
AllowToken
event AllowToken(address indexed token)
Emitted when a previously forbidden collateral token is allowed.
The address of the allowed token
Adapter Events
AllowAdapter
event AllowAdapter(address indexed targetContract, address indexed adapter)
Emitted when a new adapter and its target contract are allowed in the credit manager.
The address of the target contract the adapter interacts with
The address of the allowed adapter
ForbidAdapter
event ForbidAdapter(address indexed targetContract, address indexed adapter)
Emitted when an adapter and its target contract are forbidden in the credit manager.
The address of the target contract
The address of the forbidden adapter
Credit Manager Events
UpdateFees
event UpdateFees(
uint16 feeLiquidation,
uint16 liquidationPremium,
uint16 feeLiquidationExpired,
uint16 liquidationPremiumExpired
)
Emitted when new fee parameters are set in the credit manager.
The new liquidation premium
The new expired liquidation fee
liquidationPremiumExpired
The new expired liquidation premium
Upgrade Events
SetPriceOracle
event SetPriceOracle(address indexed priceOracle)
Emitted when a new price oracle is set in the credit manager.
The address of the new price oracle
SetCreditFacade
event SetCreditFacade(address indexed creditFacade)
Emitted when a new facade is connected to the credit manager.
The address of the new credit facade
CreditConfiguratorUpgraded
event CreditConfiguratorUpgraded(address indexed creditConfigurator)
Emitted when the credit manager’s configurator contract is upgraded.
The address of the new credit configurator
Credit Facade Events
SetBorrowingLimits
event SetBorrowingLimits(uint256 minDebt, uint256 maxDebt)
Emitted when new debt principal limits are set.
The new minimum debt amount
The new maximum debt amount
SetMaxDebtPerBlockMultiplier
event SetMaxDebtPerBlockMultiplier(uint8 maxDebtPerBlockMultiplier)
Emitted when a new max debt per block multiplier is set.
maxDebtPerBlockMultiplier
The new multiplier value
SetLossPolicy
event SetLossPolicy(address indexed lossPolicy)
Emitted when a new loss policy is set.
The address of the new loss policy contract
SetExpirationDate
event SetExpirationDate(uint40 expirationDate)
Emitted when a new expiration timestamp is set in the credit facade.
The new expiration timestamp
Enums
AllowanceAction
enum AllowanceAction {
FORBID,
ALLOW
}
Defines whether to forbid or allow a token or adapter.
Forbid the token or adapter
Allow the token or adapter