Skip to main content

What Is the Difference between an On-Chain and Off-Chain Data Source for an Oracle?

An off-chain data source is any data existing outside the blockchain, such as a price from a CEX or a weather API. An on-chain data source is information already present on the blockchain itself, like the token balance of a wallet or the transaction history of a DEX.

Oracles primarily focus on bridging the gap for off-chain data. However, an on-chain source can still be manipulated if it is a low-liquidity DEX pool, which is then incorrectly used as the single price feed.

How Does the Settlement Process for a Derivatives Trade Differ between a CEX and a DEX?
How Does a ‘Data Feed’ Differ from a Single API Call?
How Do TWAP and VWAP Oracles Source Their Price and Volume Data?
What Is a Decentralized Exchange (DEX) and How Does It Differ from a Centralized Exchange (CEX)?