Supra
Официальный кошелек Supra

How to Use Supra Oracles

December 15, 2025 - 3 min read

What Is an Oracle?

Blockchains can’t directly access real-world information. They don’t know prices, weather, exchange rates, or anything outside their own network. An oracle solves this problem by collecting off-chain data, proving that the data is legitimate, and delivering it on-chain so smart contracts can safely use it.
Without an oracle, a smart contract wouldn’t know the price of BTC, couldn’t trigger a liquidation, or verify whether a real-world event happened. Oracles are the bridge that lets blockchains interact with everything outside their closed environment.

How Supra’s Pull Oracle Works (DORA V2)

Supra’s Pull Oracle (DORA V2) uses a hybrid model designed for both speed and trust.
It begins off-chain, where a Web2 connection retrieves fresh price updates with very low latency so your dApp doesn’t wait for slow, on-chain cycles.

Once the data is fetched, it is packaged with a cryptographic proof signed by Supra’s committee. Your smart contract then verifies this proof on-chain using Supra’s verification contract. If the proof is valid, the contract can be trusted and immediately use the price.

This “fetch off-chain, verify on-chain” approach gives you the best of both worlds: fast delivery combined with strong cryptographic security. It keeps your application responsive, accurate, and safe, all while reducing unnecessary gas costs.

Why This Works: Supra’s Parallel Consensus Architecture

DORA V2 is only possible because of how Supra’s underlying consensus is designed.
Supra organizes its validator network into tribes (the full network) and clans (smaller, randomly selected subcommittees). This setup allows work to be processed in parallel rather than in a slow, single-file sequence.

Here’s what that enables:

  • Prices can be fetched off-chain extremely quickly.
  • Clans validate those prices in parallel, not one after another.
  • The larger tribe ensures strong security and honest majority assumptions.
  • The final proof is posted on-chain, so any smart contract can independently verify it.

Because of this architecture, Supra can deliver:

  • fast and fresh price updates
  • strong trust guarantees
  • lower gas usage
  • no reliance on slow, sequential consensus rounds

Most oracle networks can’t achieve this because their nodes must wait for each other in a linear path. Supra breaks the work into parallel lanes, handled by clans, while maintaining security through the larger tribe.

This built-in parallelism is the engine behind why DORA V2 performs the way it does.

Walkthrough

1. Download the Example Repository

First, clone the official GitHub repo (make sure you’re using the DoraV2 version):

https://github.com/Entropy-Foundation/oracle-pull-example/tree/feat/DoraV2

Then move into the correct directory:

cd oracle-pull-example/gRPC/javascript/evm_client

Note: I’m using the EVM client for this walkthrough, but the repo also includes examples for Sui, Aptos, CosmWasm, and more.

2. Open the main.js File

Inside this file, you’ll fill in the required configuration details.

3. Set the gRPC Server Address

For testnet:

const address = 'testnet-dora-2.supra.com';

(Mainnet is also available if needed.)

4. Choose Your Price Feed Pair Indexes

Set the pair IDs you want to request:

const pairIndexes = [0, 21, 61, 49];

You can browse all available price feeds here:

Your selected pairs correspond to:

0 > BTC_USDT
21 > BAT_USDT
61 > RUNE_USDT
49 > BNB_USDT

5. Set Your RPC URL

You need an RPC endpoint for the chain you’re testing on.
If you’re using Infura + Sepolia:

const web3 = new Web3(
  new Web3.providers.HttpProvider('https://sepolia.infura.io/v3/xxxxxxxxxxx')
);

(You can generate an RPC URL through Infura, Alchemy, or any provider.)

6. Add the Supra Pull Oracle Contract Address
Find the contract addresses here:

Since we’re using Sepolia Testnet, the pull contract is:

const contractAddress = '0x6Cd59830AAD978446e6cc7f6cc173aF7656Fb917';

7. Add Your Wallet Details

You’ll need:

  • Wallet address
  • Private key
  • Some testnet Sepolia ETH (for gas)

MetaMask makes this easy. Export your private key from your account settings.

Your transaction setup will look like this:

const gasEstimate = await contract.methods
  .GetPairPrice(hex, 0)
  .estimateGas({ from: "<WALLET ADDRESS>" });

const transactionObject = {
  from: "<WALLET ADDRESS>",
  to: contractAddress,
  data: txData,
  gas: gasEstimate,
  gasPrice: await web3.eth.getGasPrice()
};

const signedTransaction = await web3.eth.accounts.signTransaction(
  transactionObject,
  "<PRIVATE KEY>"
);

Sepolia faucet (for test ETH) here

8. Run the Example

Once everything is set:

node main.js

You should see something like:

Requesting proof for price index :  [ 0, 21, 61, 49 ]
Calling contract to verify the proofs..
Pair index :  [ '0', '21', '49', '61' ]
Pair Price :  [
  '87430300000000000000000',
  '173200000000000000',
  '875972000000000000000',
  '678500000000000000'
]

9. Converting Raw Prices to Human Values

Supra prices use 18 decimals, so convert them using:

price = raw / 1e18

Conversions:

BTC_USDT (0)
 87430300000000000000000 > 87,430.3

BAT_USDT (21)
 173200000000000000 > 0.1732

RUNE_USDT (61)
 875972000000000000000 > 875.972

BNB_USDT (49)
 678500000000000000 > 0.6785

That’s it! Mess around with it and start pulling up your prices.

twitterlinkedinfacebookmail

RECENT POSTS

Получайте новости, инсайты и многое другое

Подпишитесь на новостную рассылку Supra, чтобы получать новости, обновления, аналитические материалы об индустрии и многое другое.