Skip to main content
RedStone is a modular oracle network. It supplies real-time data feeds to smart contracts through an approach called “data-on-demand”. RedStone does not push data to the blockchain constantly. Instead, it delivers signed data packages directly to smart contracts when the transaction executes. This architecture significantly reduces gas costs. Data freshness and reliability stay high.

What you’ll be doing in this guide

This tutorial shows you how to:
  1. Integrate RedStone’s data feeds into your application on Sei
  2. Get real-time price data for the SEI token with RedStone’s SDK and data packages
  3. Understand RedStone’s “data-on-demand” architecture
  4. Implement data fetching and verification
By the end of this guide, you will have a working demo. It can fetch SEI price data from RedStone’s oracle network with the RedStone data package system.

Prerequisites

Before you start this tutorial, make sure that you have:

Technical requirements

  • Solidity knowledge: A basic understanding of smart contract development in Solidity
  • JavaScript and Node.js: To fetch data off-chain with the RedStone SDK
  • Development environment: Remix IDE, Hardhat, or a similar Solidity development setup
  • Sei network access: An RPC endpoint and access to Sei Mainnet

Required dependencies

  • RedStone SDK (@redstone-finance/sdk)
  • RedStone EVM Connector (@redstone-finance/evm-connector)

Install

Sei network configuration

Make sure that your development environment is configured for Sei:
  • Mainnet RPC: https://evm-rpc.sei-apis.com
  • Chain ID: 1329 (Sei Mainnet)

RedStone architecture overview

RedStone uses a “data-on-demand” model:
  1. Data providers: Collect data from multiple sources and sign data packages
  2. Data packages: Signed data structures that contain price information and metadata
  3. Gateway network: Distributes data packages to consumers
  4. Smart contracts: Verify signatures and extract data on-chain

Steps to fetch SEI price data

This JavaScript code fetches SEI price data with RedStone’s SDK:

Data package structure

A RedStone data package contains:
  • dataPoints: An array of price data points
  • timestampMilliseconds: When the data was signed
  • signature: The cryptographic signature from the data provider
  • dataPackageId: The identifier of the specific data feed (for example, “SEI”)

Resources