This reference guide lists different Oracles you can use when building on Optimism. Oracles (opens in a new tab) provide offchain data onchain. This allows code running on a blockchain to access a wide variety of information. For example, a stablecoin (opens in a new tab) that accepts ETH as collateral needs to know the ETH/USD exchange rate:
- How many stablecoins can we give a user for a given amount of ETH?
- Do we need to liquidate any deposits because they are under collateralized?
Different oracles have different security assumptions and different levels of decentralization. Usually they are either run by the organization that produces the information, or have a mechanism to reward entities that provide accurate information and penalize those that provide incorrect information.
There are two types of oracles:
Push oracles are updated continuously and always have up to date information available onchain.
Pull oracles are only updated when information is requested by a contract. Pull oracles are themselves divided into two types:
- Double-transaction oracles, which require two transactions. The first transaction is the request for information, which usually causes the oracle to emit an event that triggers some offchain mechanism to provide the answer (through its own transaction). The second transaction actually reads onchain the result from the oracle and uses it.
- Single-transaction oracles, which only require one transaction, such as Chainlink's random number generator (opens in a new tab). The way this works is that the transaction that requests the information includes a callback (address and the call data to provide it). When the oracle is updated (which also happens through a transaction, but one that is not sent by the user), the oracle uses the callback to inform a contract of the result.
OP Mainnet provides a Gas Price Oracle (opens in a new tab) that provides information about gas prices and related parameters. It can also calculate the total cost of a transaction for you before you send it.
This contract is a predeploy at address
This is a push Oracle. OP Mainnet (and the testnets) updates the gas price parameters onchain whenever those parameters change. The L1 gas price, which can be volatile, is only pushed once every 5 minutes, and each time can change only by up to 20%.
Chainlink (opens in a new tab) is the industry-standard decentralized computing platform powering the verifiable web. Chainlink powers verifiable applications and high-integrity markets for banking, DeFi, global trade, gaming, and other major sectors.
- Data Feeds: Chainlink Data Feeds provide a secure, reliable, and decentralized source of off-chain data to power unique smart contract use cases for DeFi and beyond.
- Automation: Chainlink Automation is an ultra-reliable and performant smart contract automation solution enabling developers to quickly scale their operations in a verifiable, decentralized, and cost-efficient manner, to build next-generation dApps.
- CCIP: Chainlink CCIP provides a secure interoperability protocol for powering token transfers and sending arbitrary messages cross-chain.
This is a push Oracle. See the Using Data Feeds guide (opens in a new tab) to learn how to use the Chainlink feeds.
The Pyth Network is a financial oracle network which delivers over 400 low-latency, high-fidelity price feeds across cryptocurrencies, FX pairs, equities, ETFs, and commodities.
- Pyth's price data is sourced from over 95 first-party sources (opens in a new tab) including exchanges, market makers, and financial services providers. -Pyth Price Feeds (opens in a new tab) offer both the real-time spot price of the asset as well as an accompanying confidence interval band around that price -The Pyth TradingView (opens in a new tab) integration allows users to view and display Pyth prices on their own website and UI.
You can explore the full catalog of Pyth Price Feed IDs for OP Mainnet and Sepolia (EVM Stable) (opens in a new tab).
RedStone (opens in a new tab) offers flexible Data Feeds for Lending Markets, Perpetuals, Options, Stablecoins, Yield Aggregators and other types of novel DeFi protocols. The infrastructure is well battle-tested and secures hundreds of millions of USD across mainnet.
Builders can choose how they want to consume the data among 3 dedicated models:
- RedStone Core (opens in a new tab) (pull oracle) - less than 10s update time, broad spectrum of feeds, best for most use cases. All Core Price Feeds (opens in a new tab) are available on OP Mainnet & OP Sepolia.
- RedStone Classic (opens in a new tab) (push oracle) - for protocols designed for the traditional oracle interface, customizable heartbeat and deviation threshold.
- RedStone X (opens in a new tab) - specifically for Perps and Options, highest update frequency and front-running protection.
Interested in integration? Get in contact (opens in a new tab) with the RedStone team!
Developer teams who want to feature products/tools on this page must meet the following criteria:
- ongoing partnership with Optimism whether formal agreement, RPGF, RFP, collaborated on specific initiatives, etc.;
- established user base and OP ecosystem engagement such as governance participation, homegrown TG or Discord participation, etc.; and
- actively maintained developer tool that aligns with OP's commitment to a magical developer experience (e.g., easy-to-use, easy-to-integrate, great DevX, highly-rated by community, etc.)
For teams that are supporting but still establishing a user base, we encourage you to share your tool on the community oracles page (opens in a new tab). You can also promote your tool in the developer forum (opens in a new tab) and signup to share your tool at the next demo day (opens in a new tab).