Overview
The Credit Configurator V3 provides functionality to configure various aspects of the Credit Manager and Credit Facade’s behavior. It serves as the administrative interface for managing tokens, adapters, fees, and other protocol parameters. Contract Location:contracts/credit/CreditConfiguratorV3.sol
Interface: ICreditConfiguratorV3.sol
Key Features
- Collateral token management and liquidation thresholds
- Adapter allowlisting for protocol integrations
- Fee configuration for liquidations
- Debt limit management
- Contract upgrades (price oracle, facade, configurator)
- Token permission management (forbidden/allowed)
- Loss policy configuration
State Variables
Immutable Variables
Contract version (always returns
3_10)Contract type identifier (always returns
"CREDIT_CONFIGURATOR")Credit manager address this configurator manages
Underlying token address of the credit manager
Token Management
addCollateralToken
Token to add as collateral
Liquidation threshold in basis points (e.g., 8500 = 85%)
Prerequisites:
- Token must be a valid ERC-20 contract
- Token must have a price feed in the price oracle
- Token must be quoted in the pool’s quota keeper
- Liquidation threshold must be ≤ underlying token’s LT
- If phantom token, its
depositedTokenmust already be added
setLiquidationThreshold
Token to set LT for
New liquidation threshold in basis points
rampLiquidationThreshold
Token to ramp LT for
Final LT after ramping completes (in bps)
Timestamp to start ramping (starts immediately if in the past)
Ramping duration in seconds (minimum 2 days)
Ramping allows for gradual reduction of liquidation thresholds without immediately putting existing positions at risk.
forbidToken
Token to forbid
- Forbidden tokens still count towards account value
- Having forbidden tokens enabled triggers safer collateral checks
- Users are incentivized to reduce exposure to forbidden tokens
- Only callable by pausable admins
allowToken
Token to allow
Adapter Management
allowAdapter
Adapter contract address
- If the adapter’s target contract already has an adapter, the old one is removed
- Adapter must be compatible with the credit manager
- Target contract must be a valid contract address
- Neither adapter nor target can be the credit manager or credit facade
forbidAdapter
Adapter to forbid
allowedAdapters
Fee Configuration
setFees
Protocol profit from liquidated account value
Liquidator’s reward from liquidated account value
Protocol profit from expired account liquidation
Liquidator’s reward from expired account liquidation
Validation rules:
- Liquidation fee must not exceed premium (same for expired)
- Expired fee/premium must not exceed non-expired values
- Sum of premium + fee must remain constant from previous values
- For expired liquidations, sum can only change if >2 weeks before expiration
Debt Limits
setDebtLimits
Minimum debt amount per account
Maximum debt amount per account
Validation:
minDebtmust be ≤maxDebtmaxDebt / minDebtmust be ≤100 / maxEnabledTokens- USD value of
minDebtmust be > 0 according to price oracle
setMaxDebtPerBlockMultiplier
Multiplier of
maxDebt (use type(uint8).max to disable)forbidBorrowing
Only callable by pausable admins. Useful for emergency situations.
Contract Upgrades
setPriceOracle
New price oracle contract address
setCreditFacade
New credit facade contract address
Whether to copy parameters from the old facade
Migrated parameters (when
migrateParams = true):- Max debt per block multiplier
- Debt limits (min/max)
- Forbidden tokens mask
- Expiration date (if both facades are expirable)
upgradeCreditConfigurator
New credit configurator address
Loss Policy
setLossPolicy
New loss policy contract address (must be a contract)
Loss policies determine which liquidations with bad debt are allowed to proceed.
Expiration
setExpirationDate
New expiration timestamp
- Automatically adjusted to be at least 2 weeks from now if closer
- Must be after current expiration date (if set)
- Only works if credit facade is expirable
View Functions
creditFacade
allowedAdapters
Events
Token Events
Adapter Events
Configuration Events
Upgrade Events
Access Control
- Configurator Only: Token management, adapter management, fee configuration, upgrades
- Pausable Admins Only:
forbidToken(),forbidBorrowing()