Skip to content

IUSDOracle ​

Git Source

Functions ​

isGuardian ​

Returns whether the given address is an enabled guardian.

solidity
function isGuardian(address addr_) external view returns (bool);

getTokenConfig ​

Returns token-level metadata used by pricing.

solidity
function getTokenConfig(address token_)
    external
    view
    returns (bool operatePaused_, bool liquidatePaused_, uint8 tokenType_, uint8 decimals_);

isTokenConfigGovernanceApproved ​

Returns whether token-level source config is governance-approved.

solidity
function isTokenConfigGovernanceApproved(address token_) external view returns (bool);

getPrice ​

Returns the price for a given token key. Intended for DexV2 and MoneyMarket.

Intentionally non-view for future flexibility. Use getPriceView() for read-only consumers.

solidity
function getPrice(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
    external
    returns (uint256 price_);

getPriceView ​

View-only variant of getPrice() for read-only consumers.

solidity
function getPriceView(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
    external
    view
    returns (uint256 price_);

getPriceDetailed ​

Returns detailed pricing: full getPrice() result, token decimals, and token peg type. Reverts with the same errors as getPrice() when pricing fails. Intended for V1 vault wrappers (T1-T4) that need both the price and token decimals.

Intentionally non-view for future flexibility. Use getPriceDetailedView() for read-only consumers.

solidity
function getPriceDetailed(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
    external
    returns (uint256 price_, uint8 decimals_, uint8 tokenType_);

getPriceDetailedView ​

View-only variant of getPriceDetailed() for read-only consumers such as vault oracles. Reverts with the same errors as getPriceView() when pricing fails.

solidity
function getPriceDetailedView(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
    external
    view
    returns (uint256 price_, uint8 decimals_, uint8 tokenType_);

getPriceDetailedViewRaw ​

Same as getPriceDetailedView(), for resolver/UI reads only. May bypass checks that can revert on the guarded getter.

Example today: L2 sequencer uptime / grace-period. Additional bypasses may be added here over time.

solidity
function getPriceDetailedViewRaw(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
    external
    view
    returns (uint256 price_, uint8 decimals_, uint8 tokenType_);

getPriceRawForMode ​

Returns the raw composed price for a token and price mode, plus token metadata. No caps, no deviation, no reverts (returns 0 on failure). Includes alt-source fallback when configured. Intended for limit handlers, auth contracts, and other consumers that always need a resolved price. Capped rate sources use getExchangeRate() (uncapped, no operate/liquidate/collateral/debt distinction). Chainlink uses the liquidate (lenient) staleness timespan.

solidity
function getPriceRawForMode(address token_, uint8 priceMode_)
    external
    view
    returns (uint256 priceRaw_, uint8 decimals_, uint8 tokenType_);

getPricesRawForMode ​

Multi-token getPriceRawForMode(), same per-token semantics. Guard (L2 sequencer) checked once per batch.

Returns three parallel arrays, one entry per token in tokens_ order.

solidity
function getPricesRawForMode(address[] calldata tokens_, uint8[] calldata priceModes_)
    external
    view
    returns (uint256[] memory pricesRaw_, uint8[] memory decimals_, uint8[] memory tokenTypes_);

Parameters

NameTypeDescription
tokens_address[]
priceModes_uint8[]One mode per token; length mismatch reverts UsdOracle__InvalidParams.

isEmodeValid ​

True if configsMap[token_] lists at least one key with this eMode.

solidity
function isEmodeValid(uint256 emode_, address token_) external view returns (bool);

getConfiguredTokenOracles ​

Returns every oracle key row for token_ with best-effort primary (and alt) leg rates and composed prices.

Uses non-reverting source reads (doRevert_ = false); failed legs surface as rate == 0 and may zero the composed price.

solidity
function getConfiguredTokenOracles(address token_)
    external
    view
    returns (ViewStructs.ConfiguredTokenOracle[] memory infos_);

Parameters

NameTypeDescription
token_addressToken to enumerate.

Returns

NameTypeDescription
infos_ViewStructs.ConfiguredTokenOracle[]One struct per configured (eMode, isOperate, isCollateral) row in configsMap[token_].