Skip to main content
This page covers how to read price feeds from the IFÁ Labs oracle on Sui Testnet. The integration model is fundamentally different from EVM — instead of calling a contract address, you pass a shared object by reference in a transaction or inspect call. If you are building on Base Mainnet or another EVM chain, see Read Latest Price for the Solidity integration guide.
The oracle package was recently redeployed — all object IDs on this page were updated. If you have older IDs saved anywhere in your code, replace them now.

Key Differences from EVM

Before writing any code, understand how Sui differs from EVM for oracle consumption:

Sui Testnet Object IDs

You need these three values before integrating:
Always pass the Feed Object ID when reading prices — not the Package ID. The Package ID is only used when importing ifa_oracle as a dependency in your own Move package.

Asset IDs on Sui

Asset IDs are the same 32-byte values as EVM — but formatted differently in Move and TypeScript.

Reading a Price in Move

Single Asset

With Freshness Check

Sui timestamps are in milliseconds. Set MAX_AGE_MS accordingly — 1 hour is 3_600_000, not 3_600. This is different from EVM where block.timestamp is in seconds.

Batch Read (Multiple Assets)

Derived Pair (Cross-Asset Price)

Derived pair functions abort if either underlying asset does not exist in the feed. Unlike EVM which returns exists = false, Sui will revert your entire transaction. Always verify both assets exist with get_asset_info before calling pair functions in production.

Reading a Price in TypeScript

Use the Sui TypeScript SDK with devInspectTransactionBlock — no wallet or gas required for read-only queries.

Setup


Single Asset Price

Full Example with BCS Deserialization


Reading via Sui CLI

For quick checks without writing code:
The asset ID is passed as a JSON array of decimal byte values — not as a hex string. The array above is the decimal representation of the USDT/USD asset ID bytes.

Converting Prices

Sui uses positive decimals — the opposite sign convention from EVM. The math is the same — only the sign of the decimal field differs. For derived pairs on Sui, the decimal is always 30:

Adding IFÁ Labs as a Move Dependency

To use the oracle in your own Move package, add it to your Move.toml:
Then import in your Move source:

Want to Build a Swap or Liquidity Pool Instead?

If you’re trying to build a price-aware swap, dust sweeper, or liquidity pool — IFÁ Labs already has a live one on Sui Testnet you can model from or integrate directly with. See Sui Swap Contract for the periphery functions (deposit_liquidity, swap_exact_input, sweep, and more) and how they consume this same IfaPriceFeed.

Getting Testnet Tokens

You need testnet SUI to deploy contracts on Sui Testnet. Price reads via devInspectTransactionBlock are free and require no tokens.

Next Steps

Sui Function Reference

Complete reference for every public function in the IFÁ Labs Sui Move contracts.

Sui Swap Contract

See the oracle in action inside a live liquidity pool.

Supported Assets

All supported feeds with asset IDs in both EVM and Sui formats.

Contract Addresses

All Sui object IDs and EVM contract addresses in one place.