Use this file to discover all available pages before exploring further.
The IFÁ Labs oracle contract exposes a focused set of read-only functions for querying price data. All functions are view — they cost no gas when called externally and have no side effects. This page is the complete reference for every function, struct, and enum in the contract interface.
The return type for cross-asset pair calculations.
struct DerivedPair { int256 price; // Derived cross-asset price, scaled int8 decimal; // Negative exponent for scaling uint256 lastUpdateTime; // Timestamp of the most recent underlying feed update}
The lastUpdateTime for a derived pair reflects the older of the two underlying feed timestamps — the derived price is only as fresh as its least-recently-updated component.
Controls the direction of a derived pair calculation.
enum PairDirection { Forward, // asset0 priced in asset1 terms: "how much asset1 is one asset0 worth?" Backward // asset1 priced in asset0 terms: "how much asset0 is one asset1 worth?"}
Results are returned in the same order as the input array.
Each element in exists corresponds to the same-index element in infos.
Does not revert if an asset ID is unrecognised — returns exists[i] = false for that element.
Always check exists[i] before using infos[i].
Example:
bytes32[] memory ids = new bytes32[](3);ids[0] = USDT_ASSET_ID;ids[1] = USDC_ASSET_ID;ids[2] = CNGN_ASSET_ID;(IIfaPriceFeed.PriceFeed[] memory infos, bool[] memory exists) = ORACLE.getAssetsInfo(ids);for (uint256 i = 0; i < ids.length; i++) { require(exists[i], "Unsupported asset in batch"); // Use infos[i].price, infos[i].decimal, infos[i].lastUpdateTime}
Use getAssetsInfo any time your contract needs more than one price in the same transaction. One external call is significantly cheaper than N consecutive getAssetInfo calls.
Forward for asset0/asset1, Backward for asset1/asset0
Returns:
Return Value
Type
Description
DerivedPair
DerivedPair
Derived price, decimal, and the older of the two underlying timestamps
Behaviour:
Both underlying USD feeds must exist and be non-zero. If either is missing, the function reverts.
Self-pairing (same asset ID for both parameters) is blocked — reverts with an error.
lastUpdateTime reflects the older of the two underlying feed timestamps.
Example:
// How much USDT is one CNGN worth?IIfaPriceFeed.DerivedPair memory pair = ORACLE.getPairbyId( CNGN_ASSET_ID, USDT_ASSET_ID, IIfaPriceFeed.PairDirection.Forward);uint256 cngnInUsdt = uint256(pair.price) / 1e18;
Returns: Array of DerivedPair structs in backward direction — asset1 priced in asset0 terms.Behaviour: Identical to getPairsbyIdForward except direction is reversed for all pairs. Same length requirement and revert behaviour apply.Example:
// How much CNGN is one USDT worth?bytes32[] memory assets0 = new bytes32[](1);bytes32[] memory assets1 = new bytes32[](1);assets0[0] = CNGN_ASSET_ID;assets1[0] = USDT_ASSET_ID;IIfaPriceFeed.DerivedPair[] memory pairs = ORACLE.getPairsbyIdBackward(assets0, assets1);// pairs[0] = USDT/CNGN (how many CNGN per USDT)
Note: getAssetInfo and getAssetsInfo do not revert on unsupported assets — they return exist = false. Only derived pair functions can revert due to missing or invalid underlying feeds.