Oracles

💡

This page includes providers that meet specific inclusion criteria, as outlined below. Please visit the community oracles page (opens in a new tab) for an additional listing of third-party Oracles.

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?

Security and decentralization

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.

Types of oracles

There are two types of oracles:

  1. Push oracles are updated continuously and always have up to date information available onchain.

  2. Pull oracles are only updated when information is requested by a contract. Pull oracles are themselves divided into two types:

    1. 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.
    2. Single-transaction oracles, which only require one transaction. 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.

Random number generation (RGN)

Random number generation in blockchain applications ensures that smart contracts can access unbiased random values. This is essential for certain use cases like generative NFTs, gaming, commit & reveal schemes and more. Various approaches include using a trusted third party, blockhash-based methods, Verifiable Random Functions (VRF), quantum random numbers to name a few. Each method has trade-offs between simplicity, security, and trust assumptions, allowing developers to select the most suitable option for their use case.

List of oracles

Gas oracle

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 0x420000000000000000000000000000000000000F:

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%.

  • Blocknative (opens in a new tab) provides real-time gas estimation powered by predictive modeling to forecast gas price distribution for select OP Stack chains, including OP Mainnet and Base. The API (opens in a new tab) is also available on Ethereum Mainnet to estimate base fee costs.

API3

The API3 Market (opens in a new tab) provides access to 200+ price feeds on Optimism Mainnet (opens in a new tab) and Testnet (opens in a new tab). The price feeds operate as a native push oracle and can be activated instantly via the Market UI.

The price feeds are delivered by an aggregate of first-party oracles (opens in a new tab) using signed data and support OEV recapture (opens in a new tab).

Unlike traditional data feeds, reading API3 price feeds (opens in a new tab) enables dApps to auction off the right to update the price feeds to searcher bots which facilitates more efficient liquidation processes for users and LPs of DeFi money markets. The OEV recaptured is returned to the dApp.

API3's QRNG provides dApps with truly random numbers based on quantum mechanics at no charge. More details here (opens in a new tab)

Chainlink

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.

Chainlink provides a number of price feeds (opens in a new tab). Those feeds are available on the production network @ Op Mainnet (opens in a new tab).

  • 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 apps.
  • 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.

  • Chainlink VRF provides cryptographically secure randomness for blockchain-based applications. More details here (opens in a new tab)

Chronicle

The first Oracle on Ethereum, Chronicle's decentralized Oracle network was originally built within MakerDAO for the development of DAI and is now available to builders on OP Mainnet and the Superchain.

  • Data Feeds: Builders can choose from 65+ data feeds, including crypto assets, yield rates, and RWAs. Chronicle's data is sourced via custom-built data models, only utilizing Tier 1 Primary Sources, such as the markets where tokens are actively traded, including Coinbase, Binance, Uniswap, and Curve.
  • Transparency & Integrity: Chronicle's Oracle network is fully transparent and verifiable. Via The Chronicle (opens in a new tab), the data supply chain for any Oracle can be viewed in real-time and historically, including data sources and the identity of all Validators/Signers. Users can cryptographically challenge the integrity of every Oracle update using the 'verify' feature. Data is independently sourced by a community of Validators (opens in a new tab), including Gitcoin, Etherscan, Infura, DeFi Saver, and MakerDAO.
  • Gas Efficiency: Pioneering the Schnorr-based Oracle architecture, Chronicle's Oracles use 60-80% less gas per update than other Oracle providers. This lowest cost per update allows Push Oracle updates to be made more regularly, ensuring more accurate and granular data reporting.

Every Oracle implementation is customized to fit your needs. Implement one of our existing data models or contact Chronicle to develop custom Oracle data feeds via Discord (opens in a new tab) or Email. Developers can dive deeper into Chronicle Protocol's architecture and unique design choices via the docs (opens in a new tab).

Gelato

Gelato VRF (opens in a new tab) enables smart contracts on Optimism to access verifiable randomness. Gelato VRF offers real randomness for blockchain applications by leveraging Drand, a trusted decentralized source for random numbers.

Gelato VRF (Verifiable Random Function) provides trustable randomness on EVM-compatible blockchains. Here's a brief overview:

  • Contract Deployment: Use GelatoVRFConsumerBase.sol as an interface for requesting random numbers.
  • Requesting Randomness: Emit the RequestedRandomness event to signal the need for a random number.
  • Processing: Gelato VRF fetches the random number from Drand.
  • Delivery: The fulfillRandomness function delivers the random number to the requesting contract.

Ready to integrate? Head over to the Gelato VRF Quick Start Guide (opens in a new tab).

Pyth Network

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.

You can explore the full catalog of Pyth Price Feed IDs for OP Mainnet and Sepolia (EVM Stable) (opens in a new tab).

  • Pyth Entropy allows developers to quickly and easily generate secure random numbers on the blockchain. More details here (opens in a new tab)

RedStone

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:

Interested in integration? Get in contact (opens in a new tab) with the RedStone team!

Inclusion criteria

Developer teams who want to feature products/tools on this page must meet the following criteria:

  1. ongoing partnership with Optimism whether formal agreement, RPGF, RFP, collaborated on specific initiatives, etc.;
  2. established user base and OP ecosystem engagement such as governance participation, homegrown TG or Discord participation, etc.; and
  3. 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).

Next steps