Skip to main content
This page walks you through three ways to fetch a price from the IFÁ Labs oracle. All three work on Base Mainnet and Base Sepolia. Choose the one that fits where you are in your development workflow.

Method 1: Remix IDE

The fastest way to fetch a price without any local setup.
1

Open Remix IDE

Go to remix.ethereum.org in your browser.
2

Create a new file

In the File Explorer, create a new file called PriceReader.sol and paste the following:
3

Compile the contract

Open the Solidity Compiler tab. Set the compiler version to 0.8.0 or higher and click Compile PriceReader.sol.
4

Deploy and call

Open the Deploy & Run Transactions tab.
  • Set Environment to Injected Provider - MetaMask
  • Make sure MetaMask is connected to Base Mainnet or Base Sepolia
  • Click Deploy
  • Once deployed, click getUSDTPrice under the deployed contract
You’ll see four return values: price, decimal, timestamp, and exists.
Interpreting the result:
Human-readable price = price ÷ 10^(-decimal) = 1e18 ÷ 10^18 = $1.00 For any stablecoin near its peg, expect a value close to 1e18 with decimal = -18.

Method 2: Basescan

No coding required. Read directly from the deployed contract via the block explorer.
2

Find getAssetInfo

Scroll to the getAssetInfo function in the Read Contract tab.
3

Enter an asset ID and query

Paste an asset ID from the table below and click Query.Results appear instantly — no wallet connection needed for read calls.

Method 3: ethers.js Script

For developers integrating IFÁ Labs into a frontend, backend, or automated workflow.
Example output:

Common Asset IDs

Use these in any of the three methods above:

What’s Happening Under the Hood

Every call to getAssetInfo reads directly from an audited smart contract on-chain. There is no API server, no middleware, and no off-chain dependency in the read path. The price you get is exactly what was last pushed by IFÁ Labs’ decentralized relayer network — verifiable by anyone on the blockchain. This also means price reads cost zero gas. View calls on EVM chains are free. The only gas cost in your integration is if you’re writing price data into your own contract’s storage.

Next Steps

Verify Price Integrity

Add staleness checks and deviation guards before going to production.

EVM Integration Guide

Build a full production integration into your smart contracts.