devInspectTransactionBlock.
For the EVM function reference, see Function Reference.
Package Structure
The IFÁ Labs Sui oracle package (ifa_oracle) contains three modules:
Consumers only need
price_feed and bytes32. The verifier module is used by the IFÁ Labs relayer infrastructure — not by protocol integrators.
Looking for a real example of these functions in production? The Sui Swap Contract consumes
get_asset_info and get_pair_by_id directly for pricing every deposit, withdrawal, and swap.Data Types
PriceFeed
The primary struct returned by all single-asset price queries.
DerivedPair
The return type for all cross-asset pair calculations.
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.Bytes32
A wrapper type for 32-byte asset identifiers.
bytes32::new() — direct struct construction is not permitted outside the module.
Direction Constants
Used as thedirection parameter in derived pair functions:
bytes32 Module
bytes32::new
Constructs a Bytes32 from a 32-byte vector<u8>. Aborts if the input is not exactly 32 bytes.
Aborts:
E_INVALID_BYTES32_LENGTH if value.length() != 32
Example:
bytes32::inner
Returns a reference to the inner vector<u8>.
bytes32::into_inner
Consumes the Bytes32 and returns the inner vector<u8>.
price_feed Module — Getter Functions
These functions extract fields from PriceFeed and DerivedPair structs.
price_feed::price
Returns the raw scaled price from a PriceFeed.
price_feed::price_decimal
Returns the scaling exponent from a PriceFeed.
18 for all current IFÁ Labs feeds. Read dynamically — do not hardcode 18.
price_feed::last_update_time
Returns the last update timestamp in milliseconds from a PriceFeed.
price_feed::derived_pair_decimal
Returns the decimal from a DerivedPair. Always 30.
price_feed::derived_pair_last_update_time
Returns the last update timestamp from a DerivedPair in milliseconds. Reflects the older of the two underlying feed timestamps.
price_feed::derived_price
Returns the raw derived price from a DerivedPair. Always scaled by 10^30.
price_feed::is_fresh
Checks whether a price feed is within a given age threshold. Returns true if fresh, false if stale.
Example:
price_feed Module — Query Functions
price_feed::get_asset_info
Fetches the current price feed for a single asset.
Returns:
Behaviour:
- Does not abort on unsupported assets — returns
(empty_price_feed, false). - Safe to call with any
Bytes32value. - Always check
existsbefore using the returnedPriceFeed.
price_feed::get_assets_info
Batch version of get_asset_info. Fetches price feeds for multiple assets in a single call.
Returns:
Behaviour:
- Results are returned in the same order as the input vector.
- Each
exists[i]corresponds toprices[i]. - Does not abort on unsupported assets — returns
falsein the exists vector for missing assets.
price_feed::get_pair_by_id
Computes a derived cross-asset price for a single pair.
Returns:
DerivedPair with decimal = 30 and derived_price scaled by 10^30.
Aborts:
E_INVALID_ASSET_PAIRING— ifasset_index_0 == asset_index_1(self-pair)E_INVALID_DIRECTION— ifdirectionis not0or1E_INVALID_ASSET_INDEX— if either asset does not exist in the feed
price_feed::get_pairs_by_id_forward
Batch derived pair calculation — all pairs in the forward direction.
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:
price_feed::get_pairs_by_id_backward
Batch derived pair calculation — all pairs in the backward direction.
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.
price_feed::get_pairs_by_id
Batch derived pair calculation with per-pair direction control.
Aborts:
E_INVALID_ASSET_OR_DIRECTION_INDEX_LENGTH if any of the three arrays have different lengths.
Example:
Error Codes
Function Quick Reference
Next Steps
Read Latest Price (Sui)
Full integration examples using Move and the Sui TypeScript SDK.
Sui Swap Contract
See these exact functions used in a live liquidity pool.
Function Reference (EVM)
The equivalent reference for EVM contract functions.
Contract Addresses
All Sui object IDs and EVM contract addresses.

