Skip to main content

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.
address
address
The credit manager contract address

creditFacade

function creditFacade() external view returns (address)
Returns the address of the associated credit facade.
address
address
The credit facade contract address

underlying

function underlying() external view returns (address)
Returns the address of the underlying asset for this credit manager.
address
address
The underlying token address

allowedAdapters

function allowedAdapters() external view returns (address[] memory)
Returns an array of all currently allowed adapter addresses.
adapters
address[]
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.
token
address
required
The address of the token to add as collateral
liquidationThreshold
uint16
required
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.
token
address
required
The address of the collateral token
liquidationThreshold
uint16
required
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.
token
address
required
The address of the collateral token
liquidationThresholdFinal
uint16
required
The final liquidation threshold after ramping completes
rampStart
uint40
required
The timestamp when the ramping should start
rampDuration
uint24
required
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.
token
address
required
The address of the token to forbid

allowToken

function allowToken(address token) external
Re-allows a previously forbidden collateral token.
token
address
required
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.
adapter
address
required
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.
adapter
address
required
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.
feeLiquidation
uint16
required
The fee charged on liquidations (in basis points)
liquidationPremium
uint16
required
The premium discount given to liquidators (in basis points)
feeLiquidationExpired
uint16
required
The fee charged on expired account liquidations (in basis points)
liquidationPremiumExpired
uint16
required
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.
newPriceOracle
address
required
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.
newCreditFacade
address
required
The address of the new credit facade contract
migrateParams
bool
required
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.
newCreditConfigurator
address
required
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.
newMinDebt
uint128
required
The minimum debt principal amount allowed
newMaxDebt
uint128
required
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
uint8
required
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.
newLossPolicy
address
required
The address of the new loss policy contract

setExpirationDate

function setExpirationDate(uint40 newExpirationDate) external
Sets a new expiration timestamp in the credit facade.
newExpirationDate
uint40
required
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.
token
address
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.
token
address
The address of the collateral token
liquidationThreshold
uint16
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.
token
address
The address of the collateral token
liquidationThresholdInitial
uint16
The initial liquidation threshold at ramp start
liquidationThresholdFinal
uint16
The final liquidation threshold at ramp end
timestampRampStart
uint40
The timestamp when ramping starts
timestampRampEnd
uint40
The timestamp when ramping ends

ForbidToken

event ForbidToken(address indexed token)
Emitted when a collateral token is forbidden.
token
address
The address of the forbidden token

AllowToken

event AllowToken(address indexed token)
Emitted when a previously forbidden collateral token is allowed.
token
address
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.
targetContract
address
The address of the target contract the adapter interacts with
adapter
address
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.
targetContract
address
The address of the target contract
adapter
address
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.
feeLiquidation
uint16
The new liquidation fee
liquidationPremium
uint16
The new liquidation premium
feeLiquidationExpired
uint16
The new expired liquidation fee
liquidationPremiumExpired
uint16
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.
priceOracle
address
The address of the new price oracle

SetCreditFacade

event SetCreditFacade(address indexed creditFacade)
Emitted when a new facade is connected to the credit manager.
creditFacade
address
The address of the new credit facade

CreditConfiguratorUpgraded

event CreditConfiguratorUpgraded(address indexed creditConfigurator)
Emitted when the credit manager’s configurator contract is upgraded.
creditConfigurator
address
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.
minDebt
uint256
The new minimum debt amount
maxDebt
uint256
The new maximum debt amount

SetMaxDebtPerBlockMultiplier

event SetMaxDebtPerBlockMultiplier(uint8 maxDebtPerBlockMultiplier)
Emitted when a new max debt per block multiplier is set.
maxDebtPerBlockMultiplier
uint8
The new multiplier value

SetLossPolicy

event SetLossPolicy(address indexed lossPolicy)
Emitted when a new loss policy is set.
lossPolicy
address
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.
expirationDate
uint40
The new expiration timestamp

Enums

AllowanceAction

enum AllowanceAction {
    FORBID,
    ALLOW
}
Defines whether to forbid or allow a token or adapter.
FORBID
uint8
Forbid the token or adapter
ALLOW
uint8
Allow the token or adapter

Build docs developers (and LLMs) love