RiskConfig
Global and per-collateral policy registry with role-gated controls.
What It Does
RiskConfig is the permissioned control plane for risk policy. Runtime modules read it to determine collateral enablement, caps, ceilings, fees, and active safe mode.
Configuration Surface
CollateralConfig includes:
- enablement and pause flags:
enabled,poolAllowed,mintPaused,redeemPaused - haircut and solvency parameters:
haircutBps,mcrBps - throughput caps: mint/redeem tx, block, and day limits
- monetary controls:
debtCeiling,mintFeeBps,redeemFeeBps - signed-quote controls:
signedQuoteEnabled,quoteSigner,maxEffectivePriceDeviationBps
GlobalConfig includes:
globalDebtCeilingglobalMintCapDayglobalRedeemCapDaysafeMode
Control Model
- admin role (
DEFAULT_ADMIN_ROLE) can callsetCollateralConfig,setGlobalConfig, andsetSafeMode - guardian role (
GUARDIAN_ROLE) can callguardianSetSafeModeto forceRedeemOnlyorPaused - config writes emit
CollateralConfigSet,GlobalConfigSet,GuardianSafeModeSet, andAdminSafeModeSet
setGlobalConfig updates numeric limits only when the supplied safeMode matches
storage. A routine update prepared before a guardian mode change therefore reverts.
Admins change mode explicitly with setSafeMode(expectedMode, nextMode), which
checks the current mode and changes no limits. Guardian permissions are unchanged.
The expected-mode check compares current state; it does not track intervening
changes that return to the same mode. Existing deployed registries require a
separately reviewed replacement to adopt this behavior.
For registered-issuer hooks, poolAllowed = false blocks AMM liquidity in unsigned swaps and signed pool-only or split routes. A fully issuer-settled signed route can still execute. enabled gates issuer settlement, while mintPaused and redeemPaused gate its respective directions.
maxEffectivePriceDeviationBpslimits signed-price deviation from the configured oracle adapter'sgetEffectivePriceoutput, in basis points.- Registered-issuer signed settlement requires a nonzero limit; manager routes treat zero differently.
signedQuoteEnabledandquoteSignerare the execution controls for quote-mode.signedQuoteEnabled = truerequires non-zeroquoteSigner.- Signed-quote mode gates vault settlement; non-signed swaps remain pure AMM when this is disabled.
Signer governance and rotation
For signer changes, use a staged sequence:
- set
signedQuoteEnabled = falsefor the collateral being rotated. - update
quoteSignerto the new signer. - verify quote service domain inputs (
chainId, verifying contract) with dry-run quotes. - re-enable
signedQuoteEnabledand canary small traffic first.
Scope notes:
- quote-mode controls are configured per collateral.
- non-signed swaps remain pure AMM without signed payloads.
- invalid supplied signed quotes still revert instead of downgrading to unsigned settlement.
Operational Discipline
Treat config writes as production control actions. For every change: record rationale, intended rollback values, and validation checks that confirm expected behavior.