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.
function addCollateralToken(address token, uint16 liquidationThreshold) external;
| Parameter | Type | Description |
|---|---|---|
token | address | ERC-20 token to add |
liquidationThreshold | uint16 | Initial 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.
function setLiquidationThreshold(address token, uint16 liquidationThreshold) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Collateral token |
liquidationThreshold | uint16 | New LT in basis points |
Access: Configurator role only.
rampLiquidationThreshold
Gradually changes a token's liquidation threshold over time to prevent sudden liquidation cascades.
function rampLiquidationThreshold( address token, uint16 ltFinal, uint40 rampStart, uint24 rampDuration ) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Collateral token |
ltFinal | uint16 | Target LT after ramping completes |
rampStart | uint40 | Timestamp when ramping begins |
rampDuration | uint24 | Duration 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.
function forbidToken(address token) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Token to forbid |
Access: Pausable Admin (no DAO vote required).
allowToken
Restores normal status to a previously forbidden token.
function allowToken(address token) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Token to allow |
Access: Configurator role only.
Fee Management
setFees
Configures liquidation fees and premiums.
function setFees( uint16 feeLiquidation, uint16 liquidationPremium, uint16 feeLiquidationExpired, uint16 liquidationPremiumExpired ) external;
| Parameter | Type | Description |
|---|---|---|
feeLiquidation | uint16 | DAO fee on standard liquidations (bps) |
liquidationPremium | uint16 | Reward for liquidators (bps) |
feeLiquidationExpired | uint16 | DAO fee for expired account liquidations (bps) |
liquidationPremiumExpired | uint16 | Liquidator 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.
function setDebtLimits(uint128 newMinDebt, uint128 newMaxDebt) external;
| Parameter | Type | Description |
|---|---|---|
newMinDebt | uint128 | Minimum principal (must have non-zero USD value) |
newMaxDebt | uint128 | Maximum 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.
function setMaxDebtPerBlockMultiplier(uint8 multiplier) external;
| Parameter | Type | Description |
|---|---|---|
multiplier | uint8 | Multiplier 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.
function forbidBorrowing() external;
Access: Pausable Admin (no DAO vote required).
Adapter Management
allowAdapter
Registers an adapter for a target DeFi protocol.
function allowAdapter(address adapter) external;
| Parameter | Type | Description |
|---|---|---|
adapter | address | Adapter 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.
function forbidAdapter(address adapter) external;
| Parameter | Type | Description |
|---|---|---|
adapter | address | Adapter to remove |
Access: Configurator role only.
System Upgrades
setPriceOracle
Switches to a new price oracle implementation.
function setPriceOracle(address newPriceOracle) external;
| Parameter | Type | Description |
|---|---|---|
newPriceOracle | address | New 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.
function setCreditFacade(address newCreditFacade, bool migrateParams) external;
| Parameter | Type | Description |
|---|---|---|
newCreditFacade | address | New CreditFacade contract |
migrateParams | bool | Whether to copy debt limits and other parameters |
Access: Configurator role only.
upgradeCreditConfigurator
Transfers the configurator role to a new contract.
function upgradeCreditConfigurator(address newCreditConfigurator) external;
| Parameter | Type | Description |
|---|---|---|
newCreditConfigurator | address | New CreditConfigurator contract |
Access: Configurator role only.
View Methods
creditManager
Returns the Credit Manager this configurator manages.
function creditManager() external view returns (address);
creditFacade
Returns the current Credit Facade address.
function creditFacade() external view returns (address);
underlying
Returns the underlying token address.
function underlying() external view returns (address);
Events
AddCollateralToken
event AddCollateralToken(address indexed token, uint16 liquidationThreshold);
Emitted when a new collateral token is registered.
SetLiquidationThreshold
event SetLiquidationThreshold(address indexed token, uint16 liquidationThreshold);
Emitted when a token's LT is changed immediately.
RampLiquidationThreshold
event RampLiquidationThreshold( address indexed token, uint16 ltFinal, uint40 rampStart, uint24 rampDuration );
Emitted when a gradual LT change is initiated.
ForbidToken
event ForbidToken(address indexed token);
Emitted when a token is marked as forbidden.
AllowToken
event AllowToken(address indexed token);
Emitted when a forbidden token is restored.
SetFees
event SetFees( uint16 feeLiquidation, uint16 liquidationPremium, uint16 feeLiquidationExpired, uint16 liquidationPremiumExpired );
Emitted when liquidation fees are updated.
SetDebtLimits
event SetDebtLimits(uint128 minDebt, uint128 maxDebt);
Emitted when debt bounds are changed.
AllowAdapter
event AllowAdapter(address indexed adapter, address indexed targetContract);
Emitted when an adapter is registered.
ForbidAdapter
event ForbidAdapter(address indexed adapter);
Emitted when an adapter is removed.
SetCreditFacade
event SetCreditFacade(address indexed creditFacade);
Emitted when the Credit Facade is upgraded.
SetPriceOracle
event SetPriceOracle(address indexed priceOracle);
Emitted when the price oracle is changed.
UpgradeCreditConfigurator
event UpgradeCreditConfigurator(address indexed creditConfigurator);
Emitted when the configurator itself is upgraded.
Access Control
| Role | Capabilities |
|---|---|
| Configurator | All structural changes: tokens, fees, adapters, debt limits, upgrades |
| Pausable Admin | Emergency 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.
Related Pages
- Credit Manager -- Core accounting engine
- Credit Facade -- User-facing interface
- Pool (PoolV3) -- Liquidity pool
- Smart Contracts Overview -- Full contract architecture