Skip to content
CryptoSober

Glossary · DeFi

Oracle

An oracle is a service that supplies a blockchain with information from outside it, such as asset prices, so smart contracts can use it.

By Abu HosainPublished 1 min read

In simple terms

A blockchain cannot look anything up for itself. An oracle is the messenger that brings in outside facts, most often prices.

How it works

A smart contract can only read data that is already on its own blockchain. It has no way to check a stock price, an exchange rate or a sports result. An oracle collects that information from outside sources and writes it to the blockchain where contracts can read it.

Better designs draw on many independent sources and many independent operators, then combine the answers, so that no single party can feed in a false value.

Example

A lending app lets users borrow against ether. It reads the ether price from an oracle. If the price falls far enough that a loan is no longer safely covered, the contract sells the borrower's collateral automatically.

Why it matters for safety

An oracle is a point of trust inside a system that claims to need none. If the price feed is wrong, delayed or manipulated, contracts act on the wrong number, and users can be liquidated unfairly or the app can be drained. Oracle manipulation has been a recurring cause of losses in DeFi.

When assessing an app, it is reasonable to ask where its prices come from, and whether they rely on one small liquidity pool that a single large trade could move.

Sources

  1. 01Ethereum.org, Oracles

This page is educational. It is not financial, investment, legal, or tax advice. See our editorial policy and how to report an error.