Skip to content

FluidUsdOracleKeyConfigs ​

Git Source

Inherits:FluidUsdOracleTokenSourceConfigs

Per-key configuration: priceMode assignment, source cap mode, overall cap, deviation check, and fallback management. Each key only stores a priceMode reference (which token-level source mapping to use) plus key-specific parameters — source feeds are never specified here, they are inherited from the token-level config. Uses the transient admin session (registerTransientOracleKey must be called first) so the key tuple is confirmed once and reused across all subsequent admin calls in the tx.

Functions ​

setPriceMode ​

Sets PRICE_MODE_PEG or PRICE_MODE_MARKET for the oracle key registered in this transaction.

Requires registerTransientOracleKey. Multisig may only create new keys; governance may update. Validates token type vs required token-level sources. STABLE + PEG is rejected when the key already has CROSS_PATH ($1 skips overall cap, which would leave a dead depeg floor). When creating: TEAM_MULTISIG cannot add eMode≠0 for a leg that already has eMode 0 if the token is governance-approved (would shadow live eMode-0 fallback). Unapproved tokens remain MS-onboardable.

solidity
function setPriceMode(uint8 priceMode_) external onlyWithTransientOracleKey onlyGovernanceOrMultisig;

Parameters

NameTypeDescription
priceMode_uint8PRICE_MODE_MARKET or PRICE_MODE_PEG.

removeConfig ​

Deletes the per-key config for the transiently registered oracle key and removes it from configsMap.

Only governance. Clears transient session after removal.

solidity
function removeConfig() external onlyGovernance onlyWithTransientOracleKey onlyForExistingConfig;

setSourceCapMode ​

Sets per-leg capping direction for the registered key (SOURCE_CAP_MIN, SOURCE_CAP_MAX, or SOURCE_CAP_NONE).

SOURCE_CAP_MIN only for collateral keys; SOURCE_CAP_MAX only for debt keys. Cap operands live on token sources.

solidity
function setSourceCapMode(uint8 sourceCapMode_)
    external
    onlyWithTransientOracleKey
    onlyGovernanceOrMSNewConfig
    onlyForExistingConfig;

Parameters

NameTypeDescription
sourceCapMode_uint8Cap mode enum value.

_revertIfReferenceSourceMissing ​

Reverts unless _tToken has a primary source on _tokenSources plus the reference source the second leg is read from: _additionalTokenSources.primarySrc for PEG (see _getPegResolvedPrice), _tokenSources.altSrc otherwise. Deviation checks and cross-path overall caps both compare against that same source.

solidity
function _revertIfReferenceSourceMissing() internal view;

setOverallCap ​

Sets overall cap mode and operand for the registered key (cross-path or operand clamp).

MIN modes require collateral keys; MAX modes require debt keys. Cross-path operand must be 0. PEG CROSS_PATH requires _tokenSources.primarySrc and additional (same as deviation). VOLATILE/STABLE MARKET require alt. STABLE PEG is rejected. setPriceMode(PEG) on STABLE and setTokenType cannot leave a live CROSS_PATH key on an incompatible mode or type. Operand modes scale overallCapOperand_ by CAP_PRECISION (2-decimal operand → ORACLE_PRECISION).

solidity
function setOverallCap(uint8 overallCapMode_, uint16 overallCapOperand_)
    external
    onlyWithTransientOracleKey
    onlyGovernanceOrMSNewConfig
    onlyForExistingConfig;

Parameters

NameTypeDescription
overallCapMode_uint8One of OVERALL_CAP_* constants.
overallCapOperand_uint162-decimal operand for operand modes; must be 0 for OVERALL_CAP_NONE and cross-path modes.

enableDeviationCheck ​

Enables operate-only max deviation between primary and reference leg (PEG: peg vs market; else primary vs alt).

Requires the appropriate second-leg sources to exist. Can be combined with fallback.

solidity
function enableDeviationCheck(uint24 maxDeviationBPS_)
    external
    onlyWithTransientOracleKey
    onlyGovernanceOrMSNewConfig
    onlyForExistingConfig;

Parameters

NameTypeDescription
maxDeviationBPS_uint24Max deviation in basis points; must satisfy 0 < maxDeviationBPS_ <= BPS_DENOMINATOR.

disableDeviationCheck ​

Disables deviation check for the registered key (maxDeviationBPS = 0).

Only governance.

solidity
function disableDeviationCheck() external onlyWithTransientOracleKey onlyGovernance onlyForExistingConfig;

enableFallback ​

Enables fallback to the alt chain for the mapping this key uses (primary vs additional for PEG market mode).

Requires the corresponding alt sources flag. Can be combined with deviation check.

solidity
function enableFallback() external onlyWithTransientOracleKey onlyGovernanceOrMSNewConfig onlyForExistingConfig;

disableFallback ​

Disables fallback for the registered key (clears KEY_FLAG_FALLBACK).

Only governance.

solidity
function disableFallback() external onlyWithTransientOracleKey onlyGovernance onlyForExistingConfig;