RedStone Upgrades Their Relayers to Support Multiple Price Feeds
What Is a Relayer? And What Does It Do?
A relayer is a system or component that acts as an intermediary to facilitate the communication or transfer of data between different systems. In blockchains, relayers are responsible for relaying data from an off-chain source to a blockchain in an appropriately formatted and verified way. RedStone has its own set of relayers for data feeds to be moved on-chain. The relayers query the DDL and push the prices on-chain to a dedicated price feed contract (see the diagram below).
Single-Feed Relayer vs Multi-Feed Relayer
Single-feed relayers are much less efficient in terms of gas, deployment, and maintenance costs. With single-feed relayers, a separate adapter contract must be deployed for each new feed that Oracles want to deliver.
With multi-feed relayers, deploying a new smart contract for every price feed is unnecessary. RedStone has one multi-feed adapter contract per chain and can update any subset of feeds supported by RedStone (available in a pull model). A multi-feed relayer also allows the grouping of several feeds and updating them more efficiently, saving gas costs due to fewer transactions. This efficiently results in adding more price feeds more quickly. Additionally, multi-feed relayers simplify the implementation of the ERC-7412 standard and future integrations of other protocols with this standard.
What Changed For RedStone’s Relayers?
For RedStone, relayers are responsible for taking data from RedStone’s Data Distribution Layer (DDL), where data is stored off-chain, and then relaying it to smart contracts of dApps. Initially, every price feed provided by RedStone had its dedicated relayer integrated into a blockchain. Now, RedStone can use a single relayer to provide multiple price feeds. The changes were also made to the smart contract infrastructure, making it simpler for external parties to participate in updating prices on-chain. RedStone is built to allow anyone to push new price data on-chain.
Benefits of Multi-Feed Relayers
- Cost efficiency: Maintaining many single relayers (bots) results in significant costs.
- Security: Monitoring an extensive network of relayers becomes increasingly complex with each new bot added in terms of security and redundancy.
- Scalability/Flexibility: Deploying a relayer that can provide the price of a couple of assets eliminates the need to manually add a new relayer for each price feed, making RedStone more ready to deploy different feeds on different networks.
Data Flow
Oracle nodes sign data and push the data to DDL: RedStone nodes sign data to prove that the data pushed onto the blockchain in-fact originates from RedStone. It also proves that the data RedStone received from its data sources (CEX, DEXs) is in-fact from the sources RedStone claims the data is from.
Multi-feed relayer fetches data from the DDL: For data to be sent to a blockchain, relayers automatically fetch data from the DDL according to a fixed timeframe. Multi-feed relayers update what should be updated on the target chain.
Data is consumed: Once the data is pushed to the target chain, dApps can use it for various purposes based on how the dApp is built. For example, updated price feeds are crucial for liquidating loans in DeFi.
System Components
Oracle Nodes: These are nodes responsible for gathering off-chain data, signing it, and then pushing this data to a decentralized data layer (DDL).
Multi-Chain Relayer: A component that fetches data from the DDL and relays it to the appropriate blockchain. It ensures that the data is updated across multiple chains as necessary.
Multi-Feed Smart Contract Adapter: A smart contract that facilitates the standardizing of data to prepare it to be put on various chains.
Fallback Multi-Chain Relayer(s): These serve as backup relayers in case the primary multi-chain relayer fails or is delayed. They ensure that the data is reliably provided. It includes relayers powered by https://www.gelato.network/.
About RedStone
RedStone is the fastest-growing modular oracle delivering diverse, high-frequency data feeds to EVM Layer1, Layer2, Rollup-as-a-Service networks, and beyond, i.e., Starknet, Fuel Network, Casper, or TON. By responding to market trends and developer needs, RedStone can support assets not available elsewhere. The modular design allows for data consumption models adjusted to specific use cases, i.e., capital-efficient LSTfi and early support of LRTs.