Skip to main content
RedStone is a modular oracle network that provides real-time data feeds to smart contracts through a unique approach called “data-on-demand”. Instead of constantly pushing data to the blockchain, RedStone delivers signed data packages directly to smart contracts at the time of transaction execution. This architecture significantly reduces gas costs while maintaining high data freshness and reliability.

What You’ll Be Doing in This Guide

In this tutorial, you’ll learn how to:
  1. Integrate RedStone’s data feeds into your application on the SEI network
  2. Retrieve real-time SEI token price data using RedStone’s SDK and data packages
  3. Understand RedStone’s unique “data-on-demand” architecture
  4. Implement fetching and data verification
By the end of this guide, you’ll have a working demo that can fetch SEI price data from RedStone’s oracle network using their data package system.

Prerequisites

Before starting this tutorial, ensure you have:

Technical Requirements

  • Solidity Knowledge: Basic understanding of Solidity smart contract development
  • JavaScript/Node.js: For off-chain data fetching using RedStone SDK
  • Development Environment: Remix IDE, Hardhat, or similar Solidity development setup
  • SEI Network Access: RPC endpoint and mainnet access for SEI

Required Dependencies

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

Install

SEI Network Configuration

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

RedStone Architecture Overview

RedStone uses a unique “data-on-demand” model:
  1. Data Providers: Collect data from multiple sources and sign data packages
  2. Data Packages: Signed data structures containing 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

Let’s implement the JavaScript code to fetch SEI price data using RedStone’s SDK:

Data Package Structure

A RedStone data package contains:
  • dataPoints: Array of price data points
  • timestampMilliseconds: When the data was signed
  • signature: Cryptographic signature from the data provider
  • dataPackageId: Identifier for the specific data feed (e.g., “SEI”)

Resources