Complete reference for every public function in the IFÁ Labs Sui Move oracle contracts — signatures, parameters, return types, and usage notes.
This page is the complete reference for every public function exposed by the IFÁ Labs Sui Move oracle package. All functions are read-only — they do not modify on-chain state and do not require gas when called via devInspectTransactionBlock.For the EVM function reference, see Function Reference.
The primary struct returned by all single-asset price queries.
public struct PriceFeed has copy, drop, store { price: u256, // Scaled price value — always positive decimal: u8, // Positive scaling exponent e.g. 18 last_update_time: u64, // Unix timestamp in milliseconds}
Field
Type
Description
price
u256
Raw scaled price. Divide by 10^decimal for the human-readable value.
decimal
u8
Positive scaling exponent. All current feeds return 18.
last_update_time
u64
Unix timestamp in milliseconds of the last update. Note: milliseconds, not seconds.
last_update_time is in milliseconds on Sui. When comparing against clock::timestamp_ms(clock), use millisecond thresholds. 3_600_000 is 1 hour — not 3_600.
The return type for all cross-asset pair calculations.
public struct DerivedPair has copy, drop, store { decimal: u8, // Always 30 for derived pairs last_update_time: u64, // Older of the two underlying feed timestamps (milliseconds) derived_price: u256, // Cross-asset price scaled by 10^30}
Field
Type
Description
decimal
u8
Always 30 for all derived pairs — fixed, not per-asset.
last_update_time
u64
The older of the two underlying feed timestamps in milliseconds.
derived_price
u256
Cross-asset price scaled by 10^30. Divide by 10^30 for human-readable value.
The derived pair decimal is always 30 regardless of which assets are involved. This differs from EVM where the decimal is per-asset. Always divide derived_price by 10^30.
let (feed, exists) = price_feed::get_asset_info(oracle_feed, asset_id);assert!(exists, 0);let raw_price = price_feed::price(feed);// Divide by 10^decimal for human-readable value
Returns:DerivedPair with decimal = 30 and derived_price scaled by 10^30.Aborts:
E_INVALID_ASSET_PAIRING — if asset_index_0 == asset_index_1 (self-pair)
E_INVALID_DIRECTION — if direction is not 0 or 1
E_INVALID_ASSET_INDEX — if either asset does not exist in the feed
This function aborts if either asset is missing — it does not return a false flag. Always verify both assets exist with get_asset_info before calling this function in production.
Batch derived pair calculation — all pairs in the forward direction.
public fun get_pairs_by_id_forward( feed: &IfaPriceFeed, asset_indexes_0: vector<Bytes32>, asset_indexes_1: vector<Bytes32>,): vector<DerivedPair>
Parameters:
Parameter
Type
Description
feed
&IfaPriceFeed
Shared feed object
asset_indexes_0
vector<Bytes32>
Array of first assets (numerator)
asset_indexes_1
vector<Bytes32>
Array of second assets (denominator)
Returns:vector<DerivedPair> — same order as inputs. All pairs computed in forward direction.Aborts:E_INVALID_ASSET_INDEX_LENGTH if input arrays have different lengths.Example:
Batch derived pair calculation — all pairs in the backward direction.
public fun get_pairs_by_id_backward( feed: &IfaPriceFeed, asset_indexes_0: vector<Bytes32>, asset_indexes_1: vector<Bytes32>,): vector<DerivedPair>
Identical to get_pairs_by_id_forward except all pairs are computed in the backward direction (asset1 / asset0).Aborts:E_INVALID_ASSET_INDEX_LENGTH if input arrays have different lengths.