RedStone 백서

RedStone

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 3쪽 중 1쪽

On this page RedStone has become key infrastructure for DeFi and institutions bringing real-world assets onchain. Our infrastructure underpins some of the largest markets in onchain finance and delivers critical data and settlement rails for tokenized assets from BlackRock (BUIDL), Apollo (ACRED), Hamilton Lane (SCOPE), and many other leading firms - helping solve the liquidity and accessibility challenges that stand between institutions and digital assets. RedStone's offering is organized around a three-layer stack spanning data delivery, capital efficiency, and risk intelligence. Stage 1: Market Data ​ The base layer. Every protocol needs reliable price data before anything else can work. RedStone delivers on-chain price feeds, data streaming, and risk infrastructure to 200+ protocols across 110+ chains, with $8.18B+ in collateral secured and no mispricing or downtime events on record. Stage 1 includes push feeds for lending markets and vaults, pull feeds for gas-efficient integrations, RedStone Bolt for high-throughput chains where block times fall below the cadence of standard oracles, RedStone Live for off-chain streaming to perpetual exchanges and trading systems, and Proof of Reserve for tokenized assets that require on-chain verification of their backing. Stage 2: Capital Efficiency ​ Addresses what happens after price data arrives. RedStone Settle provides instant liquidity for RWA collateral, bridging the gap between DeFi's instant settlement requirement and the redemption windows of tokenized real-world assets. RedStone Atom captures Oracle Extractable Value by running sealed-bid auctions before liquidation-triggering price updates go on-chain, returning value to protocols rather than MEV bots. Stage 3: Risk Intelligence ​ Adds credit assessment to the stack. Credora provides continuous, on-chain risk ratings for DeFi tokens, loan pairs, and vaults, built on methodologies that translate to traditional credit equivalents. This gives curators and lenders an independent view of what they are actually lending against, beyond what a price feed alone can tell them. Most protocols use more than one product in the stack. Start with the stage most relevant to your use case and work outward from there. Contact RedStone for integration support. ## /docs/introduction On this page RedStone has become key infrastructure for DeFi and institutions bringing real-world assets onchain. Our infrastructure underpins some of the largest markets in onchain finance and delivers critical data and settlement rails for tokenized assets from BlackRock (BUIDL), Apollo (ACRED), Hamilton Lane (SCOPE), and many other leading firms - helping solve the liquidity and accessibility challenges that stand between institutions and digital assets. RedStone's offering is organized around a three-layer stack spanning data delivery, capital efficiency, and risk intelligence. Stage 1: Market Data ​ The base layer. Every protocol needs reliable price data before anything else can work. RedStone delivers on-chain price feeds, data streaming, and risk infrastructure to 200+ protocols across 110+ chains, with $8.18B+ in collateral secured and no mispricing or downtime events on record. Stage 1 includes push feeds for lending markets and vaults, pull feeds for gas-efficient integrations, RedStone Bolt for high-throughput chains where block times fall below the cadence of standard oracles, RedStone Live for off-chain streaming to perpetual exchanges and trading systems, and Proof of Reserve for tokenized assets that require on-chain verification of their backing. Stage 2: Capital Efficiency ​ Addresses what happens after price data arrives. RedStone Settle provides instant liquidity for RWA collateral, bridging the gap between DeFi's instant settlement requirement and the redemption windows of tokenized real-world assets. RedStone Atom captures Oracle Extractable Value by running sealed-bid auctions before liquidation-triggering price updates go on-chain, returning value to protocols rather than MEV bots. Stage 3: Risk Intelligence ​ Adds credit assessment to the stack. Credora provides continuous, on-chain risk ratings for DeFi tokens, loan pairs, and vaults, built on methodologies that translate to traditional credit equivalents. This gives curators and lenders an independent view of what they are actually lending against, beyond what a price feed alone can tell them. Most protocols use more than one product in the stack. Start with the stage most relevant to your use case and work outward from there. Contact RedStone for integration support. ## /docs/category/stage-1-market-data 📄️ Overview Every protocol in DeFi (lending markets, perpetual exchanges, structured products, prediction markets) needs reliable price data before anything else can work. A lending market that can't determine the value of its collateral cannot safely liquidate. A perp DEX without continuous pricing cannot maintain a mark price. A tokenized asset without verifiable backing cannot be accepted by a risk curator. 🗃 Price Feeds 2 items 📄️ Bolt RedStone Bolt is a real-time push oracle purpose-built for blockchains where block times are measured in milliseconds. 🗃 Live 2 items 📄️ Proof of Reserve A tokenized asset issuer claims a certain level of reserve backing. A Proof of Reserve feed makes that claim verifiable onchain, in real time, by any protocol or user who needs it. 📄️ Sanctions Oracle The RedStone Sanctions Oracle keeps sanctioned wallets out of your protocol. It publishes a screened list of designated addresses onchain, so any smart contract can check a counterparty with a single read call and refuse the transaction if the address is listed. ## /docs/stage1-market-data/overview On this page Every protocol in DeFi (lending markets, perpetual exchanges, structured products, prediction markets) needs reliable price data before anything else can work. A lending market that can't determine the value of its collateral cannot safely liquidate. A perp DEX without continuous pricing cannot maintain a mark price. A tokenized asset without verifiable backing cannot be accepted by a risk curator. Market data is the base layer. Getting it wrong propagates through every other part of the stack. Different use cases have genuinely different requirements. A lending protocol on Ethereum needs reliable, tamper-resistant prices at regular intervals. A perpetual exchange on MegaETH needs prices arriving faster than blocks are produced. An off-chain risk engine needs a stream it can consume before anything touches a chain. A tokenized gold fund needs proof that the gold actually exists. A single delivery model cannot serve all of these. RedStone's Stage 1 Stack is a set of distinct products, each designed for a specific class of requirement. Products ​ Push Model ​ Price data stored on-chain by a relayer, updated on a configured heartbeat and deviation threshold. Compatible with interfaces used by the top DeFi protocols. The standard integration path for lending markets, vaults, and protocols that need always-available onchain prices without modifying transaction logic. Pull Model ​ Price data injected into the user's transaction at execution time. More gas-efficient than push for protocols where prices don't need to be on-chain continuously. Suitable for applications where the user or protocol triggers price delivery as part of their own transaction. RedStone Bolt ​ A push oracle delivering a new price update up to every 10ms. Built for high-throughput blockchains where block times fall below the cadence of standard push oracles. Bolt uses the same push interface as standard push feeds, requiring no contract changes. Currently live on MegaETH and Monad. RedStone Live ​ An off-chain WebSocket data stream covering equities, commodities, FX, indices, and crypto. Designed for perpetual exchanges, synthetic asset platforms, off-chain risk engines, and any use case where real-time data is consumed before it reaches a blockchain. Configurable per feed: rollover methodology, data sourcing, off-hours pricing, custom signing. Proof of Reserve ​ Onchain cryptographic verification that a tokenized asset's offchain backing exists and matches the claimed amount. Used by tokenized commodities, stablecoins, private credit funds, and any RWA that needs to be accepted as collateral by a lending market or risk curator. Supports a wide range of attestation methods, including TEE-based computation for privacy-sensitive assets. How RedStone selects the right product ​ Prospective integrators are not expected to determine the appropriate product configuration before engaging RedStone. That determination is made collaboratively, based on a technical assessment of the protocol's architecture, target chain, data requirements, risk model, and deployment timeline. Every integration begins with a scoping conversation. RedStone's team works through the parameters established in the process and designs the configuration accordingly. In many cases, the optimal solution involves multiple products. A tokenized asset, for instance, may require a Proof of Reserve feed for fundamental valuation, a Push feed for the lending market accepting it as collateral, and a Live stream for the offchain risk engine monitoring positions. Once the appropriate configuration is established, RedStone manages the setup, methodology implementation, infrastructure monitoring, and ongoing maintenance. The integrating team is responsible for the protocol-side integration; RedStone operates the data infrastructure end-to-end. To begin the scoping process, contact RedStone with a description of your integration. ## /docs/stage1-market-data/price-feeds/push-model On this page Ideal for dApps deeply integrated with existing protocols and traditional data consumption patterns RedStone's Push Model stores data directly on-chain through periodic updates, following the traditional blockchain oracle approach. This model ensures constant data availability and gives applications full control over update conditions and data sources. Here you can find the list of all the feeds available with update parameters. info RedStone Push has a significant advantage over traditional push oracles. Our modular design gives you a decisive voice on when and how the price is updated (with other oracles you have to accept dictated parameters). How RedStone Push works ​ This approach is built on top of the RedStone Pull model maintaining the security of on-chain validation of data providers and timestamps. The model consists of two main parts. The first one is the off-chain relayer responsible for pushing data on-chain in a customized way using environment variables . The second part is the on-chain contracts which enable storing prices and getting them through a familiar interface (e.g. the Chainlink Aggregator ). RedStone Push can be used on all EVM-compatible L1s & L2s + Starknet + Fuel Network. Relayer ​ The relayer is a service that works in a customizable way based on environment variables . It periodically checks a defined set of conditions, pushing the prices when they are satisfied. It is possible to pass multiple conditions to the UPDATE_CONDITIONS , then the relayer will work in the manner that if any conditions are met prices will be updated. Currently, two conditions are implemented: a time condition described by UPDATE_PRICE_INTERVAL variable in milliseconds, which states how often prices should be updated (aka heartbeat), code a value-deviation condition described by MIN_DEVIATION_PERCENTAGE variable which indicates how much value should change in order to trigger the price update, code . info Relayers are permissionless and anyone could run the service as the data is eventually validated on-chain using conditions defined by the protocol stakeholders. Moreover, the relayers are designed to work in parallel and we recommend having multiple (ideally independent) instances to mitigate the risks of a single point of failure and censorship. Contracts ​ The on-chain relayer is based on the PriceFeedsAdapter contract which is responsible for: storing all price feeds' symbols (mappings to RedStone dataFeedId), storing price feeds values, updating price feeds values in batch, storing information regarding the round number and timestamp of the last update, getting prices for multiple feeds' values in a single call. Additionally, if the protocol wants to be 100% compatible with the Chainlink PriceFeed architecture, it's possible to deploy additional PriceFeed contracts to mimic this solution. Chain-specific differences While RedStone works out of the box across EVM-compatible chains, individual networks may implement certain mechanics differently. We recommend reviewing the target chain's own documentation as part of your integration process. Networks with notable differences: Arc — EVM-compatible, but uses USDC as its native gas token, handles native vs. ERC-20 USDC decimals differently, and has different native transfer event behavior than typical chains. See Arc's documentation for details. Environment variables ​ Variable Description RELAYER_ITERATION_INTERVAL Time interval in which the relayer tries to update prices UPDATE_CONDITIONS Array of parameters that describes what decides if prices can be updated, currently acceptable parameters are 'time' and 'value-deviation' UPDATE_PRICE_INTERVAL Time interval that describes how often prices should be updated if UPDATE_CONDITIONS contains the "time" parameter MIN_DEVIATION_PERCENTAGE Minimum deviation of the prices that triggers prices update if UPDATE_CONDITIONS contains "value-deviation" RPC_URL URL of RPC for interaction with blockchain CHAIN_NAME Chain name of the blockchain relayer should work on CHAIN_ID Chain id of the blockchain relayer should work on PRIVATE_KEY Private key of the wallet with funds on a proper network to push prices to the adapter contract ADAPTER_CONTRACT_ADDRESS Address of the adapter contract deployed on a proper network DATA_SERVICE_ID RedStone Wrapper parameter that describes what data services should be used to fetch the price UNIQUE_SIGNERS_COUNT RedStone Wrapper parameter that describes how many unique signers should sign price data DATA_FEEDS RedStone Wrapper parameter that describes what tokens will be used CACHE_SERVICE_URLS RedStone Wrapper parameter that describes what cache services URLs will be used to fetch the price GAS_LIMIT Gas limit used to push data to the price feed contract ## /docs/stage1-market-data/price-feeds/pull-model On this page RedStone's Pull Model injects data directly into user transactions, maximizing gas efficiency while simplifying dApp data access. This streamlined approach handles the entire process in a single transaction, significantly reducing costs. Best suited for dApps that require low-latency data. Installation ​ Install @redstone-finance/evm-connector and @redstone-finance/sdk from NPM registry Hardhat ​ Yarn NPM yarn add @redstone-finance/evm-connector @redstone-finance/sdk npm install @redstone-finance/evm-connector @redstone-finance/sdk Foundry ​ Foundry installs dependencies using git submodules. Thus additional steps are needed to install dependencies . In foundry project: Install @redstone-finance/evm-connector - it will install current code from main branch forge install redstone-finance/redstone-oracles-monorepo Install @OpenZeppelin contracts (dependency of @redstone-finance/evm-connector ) - it will install current code from main branch forge install OpenZeppelin/openzeppelin-contracts@v4.9.5 Add libraries to remappings.txt echo "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/ @openzeppelin/contracts=lib/openzeppelin-contracts/contracts/" >> remappings.txt Usage ​ TLDR; You need to do 2 things: Adjust your smart contracts to include the libraries responsible for data extraction and verification Adjust Javascript code of your dApp to inject the additional payload with data feeds, using API key(s) from RedStone (otherwise you will get smart contract errors). If this code runs in your dApp's frontend, you'll also need a proxy in front of RedStone's gateway. 1. Adjust your smart contracts ​ Heads up Our contracts require solidity > 0.8.4 . If your code is written in an older version please use the Manual Payload . If you work with 3rd party aggregators, make sure that they also support passing the additional payload. Please don't use Remix to test RedStone, as Remix does not support modifying transactions in the way that the evm-connector does We strongly recommend having some upgradability mechanism for your contracts (it can be based on multisig or DAO). This way, you can quickly replace data providers in case of any issues. You need to apply a minimum change to the source code to enable smart contract to access data. Your contract needs to extend one of our base contracts , depending on which data service are you going to use. List of base contracts with data services Base Contract Data service with the list of feeds Status PrimaryProdDataServiceConsumerBase.sol redstone-primary-prod Production 💡 Note: Services with Production status have got multiple nodes deployed and are professionally monitored. import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol" ; contract YourContractName is MainDemoConsumerBase { . . . } You should pass the data feed id converted to bytes32 . Getting a single value Getting several values uint256 ethPrice = getOracleNumericValueFromTxMsg ( bytes32 ( "ETH" ) ) ; bytes32 [ ] memory dataFeedIds = new bytes32 [ ] ( 2 ) ; dataFeedIds [ 0 ] = bytes32 ( "ETH" ) ; dataFeedIds [ 1 ] = bytes32 ( "BTC" ) ; uint256 [ ] memory values = getOracleNumericValuesFromTxMsg ( dataFeedIds ) ; uint256 ethPrice = values [ 0 ] ; uint256 btcPrice = values [ 1 ] ; For all the supported feeds we provide UI with charts and historical data 💡 Note: You can also override the following functions (do it at your own risk): isTimestampValid(uint256 receivedTimestamp) returns (bool) - to enable custom logic of timestamp validation. You may specify a shorter delay to accept only the most recent price fees. However, on networks with longer block times, you may extend this period to avoid rejecting too many transactions. aggregateValues(uint256[] memory values) returns (uint256) - to enable custom logic of aggregating values from different providers (by default this function takes the median value). For example, you may request values from providers to be strictly equal while dealing with discrete numbers. getAuthorisedSignerIndex(address _signerAddress) returns (uint256) - to whitelist additional signers or remove corrupted ones. getUniqueSignersThreshold() returns (uint256) - to modify number of required signers. The higher number means greater reliability but also higher gas costs. 2. Adjust Javascript code of your dApp ​ You should also update the code responsible for submitting transactions. If you're using ethers.js , we've prepared a dedicated library to make the transition seamless. Contract object wrapping ​ First, you need to import the wrapper code to your project Javascript Typescript const { WrapperBuilder } = require ( "@redstone-finance/evm-connector" ) ; import { WrapperBuilder } from "@redstone-finance/evm-connector" ; Then you can wrap your ethers contract pointing to the selected RedStone data service id. You can (optionally) specify a number of unique signers and data feed identifiers, and must also pass authenticatedGateways (see below ). import { getSignersForDataServiceId } from "@redstone-finance/sdk" ; const yourEthersContract = new ethers . Contract ( address , abi , provider ) ; co
프로젝트로 돌아가기