IUSDOracle ​
Functions ​
isGuardian ​
Returns whether the given address is an enabled guardian.
function isGuardian(address addr_) external view returns (bool);getTokenConfig ​
Returns token-level metadata used by pricing.
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.
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.
function getPrice(address token_, uint256 emode_, bool isOperate_, bool isCollateral_)
external
returns (uint256 price_);getPriceView ​
View-only variant of getPrice() for read-only consumers.
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.
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.
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.
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.
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.
function getPricesRawForMode(address[] calldata tokens_, uint8[] calldata priceModes_)
external
view
returns (uint256[] memory pricesRaw_, uint8[] memory decimals_, uint8[] memory tokenTypes_);Parameters
| Name | Type | Description |
|---|---|---|
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.
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.
function getConfiguredTokenOracles(address token_)
external
view
returns (ViewStructs.ConfiguredTokenOracle[] memory infos_);Parameters
| Name | Type | Description |
|---|---|---|
token_ | address | Token to enumerate. |
Returns
| Name | Type | Description |
|---|---|---|
infos_ | ViewStructs.ConfiguredTokenOracle[] | One struct per configured (eMode, isOperate, isCollateral) row in configsMap[token_]. |