DocumentationOpen App

Credit Configurator

The CreditConfiguratorV3 is the administrative gateway for the Credit Suite. It validates parameter changes and propagates them to the Credit Manager and Credit Facade. It does not store configuration state itself -- it acts as a validation and access-control layer.

User/DAO -> CreditConfiguratorV3 (validation) -> CreditManagerV3/CreditFacadeV3 (state)

Write Methods

Token & Collateral Management

addCollateralToken

Registers a new collateral token with an initial liquidation threshold.

Solidity
function addCollateralToken(address token, uint16 liquidationThreshold) external;
ParameterTypeDescription
tokenaddressERC-20 token to add
liquidationThresholduint16Initial LT in basis points (e.g., 8500 = 85%)

Validation: Token must have a price feed in PriceOracle, be quoted in PoolQuotaKeeper, and LT cannot exceed the underlying token's LT.

Access: Configurator role only.


setLiquidationThreshold

Sets the liquidation threshold for a collateral token immediately.

Solidity
function setLiquidationThreshold(address token, uint16 liquidationThreshold) external;
ParameterTypeDescription
tokenaddressCollateral token
liquidationThresholduint16New LT in basis points

Access: Configurator role only.


rampLiquidationThreshold

Gradually changes a token's liquidation threshold over time to prevent sudden liquidation cascades.

Solidity
function rampLiquidationThreshold( address token, uint16 ltFinal, uint40 rampStart, uint24 rampDuration ) external;
ParameterTypeDescription
tokenaddressCollateral token
ltFinaluint16Target LT after ramping completes
rampStartuint40Timestamp when ramping begins
rampDurationuint24Duration of linear interpolation (seconds)

Access: Configurator role only. The current LT is linearly interpolated between the initial and final values over the ramp period.


forbidToken

Marks a token as forbidden (high-risk). Forbidden tokens still count toward collateral (with safe pricing) but quota increases and balance increases are restricted.

Solidity
function forbidToken(address token) external;
ParameterTypeDescription
tokenaddressToken to forbid

Access: Pausable Admin (no DAO vote required).


allowToken

Restores normal status to a previously forbidden token.

Solidity
function allowToken(address token) external;
ParameterTypeDescription
tokenaddressToken to allow

Access: Configurator role only.


Fee Management

setFees

Configures liquidation fees and premiums.

Solidity
function setFees( uint16 feeLiquidation, uint16 liquidationPremium, uint16 feeLiquidationExpired, uint16 liquidationPremiumExpired ) external;
ParameterTypeDescription
feeLiquidationuint16DAO fee on standard liquidations (bps)
liquidationPremiumuint16Reward for liquidators (bps)
feeLiquidationExpireduint16DAO fee for expired account liquidations (bps)
liquidationPremiumExpireduint16Liquidator reward for expired accounts (bps)

Constraints: feeLiquidation <= liquidationPremium, feeLiquidationExpired <= feeLiquidation, and liquidationPremium + feeLiquidation < 100%.

Access: Configurator role only.


Debt Limits

setDebtLimits

Sets the minimum and maximum debt bounds per Credit Account.

Solidity
function setDebtLimits(uint128 newMinDebt, uint128 newMaxDebt) external;
ParameterTypeDescription
newMinDebtuint128Minimum principal (must have non-zero USD value)
newMaxDebtuint128Maximum principal

Validation: minDebt <= maxDebt. Safety ratio ensures min debt is large enough to make liquidation economical.

Access: Configurator role only.


setMaxDebtPerBlockMultiplier

Sets the per-block borrowing cap multiplier.

Solidity
function setMaxDebtPerBlockMultiplier(uint8 multiplier) external;
ParameterTypeDescription
multiplieruint8Multiplier applied to maxDebt for per-block limit

Access: Configurator role only.


forbidBorrowing

Emergency action that immediately halts all new borrowing by setting the per-block multiplier to 0.

Solidity
function forbidBorrowing() external;

Access: Pausable Admin (no DAO vote required).


Adapter Management

allowAdapter

Registers an adapter for a target DeFi protocol.

Solidity
function allowAdapter(address adapter) external;
ParameterTypeDescription
adapteraddressAdapter contract address

Validation: Adapter must implement creditManager() returning this Credit Manager and targetContract() returning the DeFi protocol. Cannot target the Facade or Manager itself.

Access: Configurator role only.


forbidAdapter

Removes a registered adapter.

Solidity
function forbidAdapter(address adapter) external;
ParameterTypeDescription
adapteraddressAdapter to remove

Access: Configurator role only.


System Upgrades

setPriceOracle

Switches to a new price oracle implementation.

Solidity
function setPriceOracle(address newPriceOracle) external;
ParameterTypeDescription
newPriceOracleaddressNew PriceOracle contract

Access: Configurator role only. New oracle must support all configured collateral tokens.


setCreditFacade

Migrates to a new Credit Facade, optionally copying existing parameters.

Solidity
function setCreditFacade(address newCreditFacade, bool migrateParams) external;
ParameterTypeDescription
newCreditFacadeaddressNew CreditFacade contract
migrateParamsboolWhether to copy debt limits and other parameters

Access: Configurator role only.


upgradeCreditConfigurator

Transfers the configurator role to a new contract.

Solidity
function upgradeCreditConfigurator(address newCreditConfigurator) external;
ParameterTypeDescription
newCreditConfiguratoraddressNew CreditConfigurator contract

Access: Configurator role only.


View Methods

creditManager

Returns the Credit Manager this configurator manages.

Solidity
function creditManager() external view returns (address);

creditFacade

Returns the current Credit Facade address.

Solidity
function creditFacade() external view returns (address);

underlying

Returns the underlying token address.

Solidity
function underlying() external view returns (address);

Events

AddCollateralToken

Solidity
event AddCollateralToken(address indexed token, uint16 liquidationThreshold);

Emitted when a new collateral token is registered.

SetLiquidationThreshold

Solidity
event SetLiquidationThreshold(address indexed token, uint16 liquidationThreshold);

Emitted when a token's LT is changed immediately.

RampLiquidationThreshold

Solidity
event RampLiquidationThreshold( address indexed token, uint16 ltFinal, uint40 rampStart, uint24 rampDuration );

Emitted when a gradual LT change is initiated.

ForbidToken

Solidity
event ForbidToken(address indexed token);

Emitted when a token is marked as forbidden.

AllowToken

Solidity
event AllowToken(address indexed token);

Emitted when a forbidden token is restored.

SetFees

Solidity
event SetFees( uint16 feeLiquidation, uint16 liquidationPremium, uint16 feeLiquidationExpired, uint16 liquidationPremiumExpired );

Emitted when liquidation fees are updated.

SetDebtLimits

Solidity
event SetDebtLimits(uint128 minDebt, uint128 maxDebt);

Emitted when debt bounds are changed.

AllowAdapter

Solidity
event AllowAdapter(address indexed adapter, address indexed targetContract);

Emitted when an adapter is registered.

ForbidAdapter

Solidity
event ForbidAdapter(address indexed adapter);

Emitted when an adapter is removed.

SetCreditFacade

Solidity
event SetCreditFacade(address indexed creditFacade);

Emitted when the Credit Facade is upgraded.

SetPriceOracle

Solidity
event SetPriceOracle(address indexed priceOracle);

Emitted when the price oracle is changed.

UpgradeCreditConfigurator

Solidity
event UpgradeCreditConfigurator(address indexed creditConfigurator);

Emitted when the configurator itself is upgraded.


Access Control

RoleCapabilities
ConfiguratorAll structural changes: tokens, fees, adapters, debt limits, upgrades
Pausable AdminEmergency actions: forbidToken, forbidBorrowing (no DAO vote required)

The Credit Manager and Facade verify all configuration calls originate from the registered Configurator via the creditConfiguratorOnly modifier.