Getting Started with Redstone Classic
Introduction
RedStone Classic allows you to leverage real-world data in your smart contracts on supported blockchains like Ethereum, Polygon, and Optimism. It provides a modular system to optimize data flow and reduce costs.
Overview
RedStone uses a network of professional data Aggregators who source real-world data from exchanges, APIs, and other sources.
Aggregators sign the data and broadcast it off-chain on data Availability layers like Streamr.
Smart contracts can request data via RedStone's SDK or Relayers. Relayers retrieve off-chain data and submit transactions to put data on-chain.
Smart contracts unpack the data, verify signatures, and use the real-world data to trigger programmatic logic.
Getting Started
Install the RedStone SDK in your smart contract development environment.
Import the RedStone contracts into your project. These handle verification and unpacking.
Call the requestData function in your contract providing the asset and identifiers.
Consume the returned real-world data in your contract logic to build dynamic dApps.
Optionally become a Relayer to retrieve off-chain data and submit transactions to insert it on-chain for contracts.
Key Benefits
Real-time data for dApps without paying gas for frequent updates.
Modular architecture optimizes data delivery and validation.
Professional grade data suitable for DeFi, gambling, insurance, and more.
Cross-chain support including Ethereum, Polygon, Optimism, and Arbitrum.
Key variables include:
UPDATE_PRICE_INTERVAL - Time interval in ms for pushing updated prices (heartbeat)
MIN_DEVIATION_PERCENTAGE - Minimum price change percentage to trigger update
UPDATE_CONDITIONS - Additional conditions that trigger a price update
For full variables, kindly check official doc here: https://docs.redstone.finance/docs/smart-contract-devs/get-started/redstone-classic#environment-variables
Last updated