Skip to main content
Please view the third-party content disclaimer here.
Supra provides oracle price feeds for EVM-compatible chains including Polygon. Two integration patterns are available: Pull Oracle (fetch proof data off-chain, then submit onchain) and Push Oracle (read S-Values directly from an onchain contract).

Pull Oracle integration

The Pull Oracle fetches proof data from Supra’s gRPC server and passes it to your smart contract via a JavaScript client.

Prerequisites

  • Node.js installed.
  • A deployed smart contract that accepts Supra proof data.

Install dependencies

Clone the Supra repository or download the source, then run:

Configure main.js

Set the following parameters before running the client. gRPC server address: REST server address: Pair indexes (example):
Chain type:
RPC URL:

Configure contract interaction

Update the ABI path:
Set the contract address:
Update the function call to match your contract:
Estimate gas:
Build the transaction:
Sign with your private key:

Run the application

This retrieves proof data from Supra’s servers and submits it to your contract using the configured parameters.

Push Oracle integration

The Push Oracle exposes real-time data feeds (S-Values) directly onchain through a Solidity interface.

Step 1: Define the S-Value interface

Add this interface to your contract:

Step 2: Initialize the feed address

Set the S-Value feed contract in your constructor. Replace the address below with the correct network-specific Supra contract address.

Step 3: Read S-Value data

Use these functions to fetch single or multiple S-Values, or derive new data pairs:
Add an owner-controlled function to update the Supra feed contract address for future upgrades: