InfrastructureIntermediate

What is Oracle?

A service that brings external data onto a blockchain, since smart contracts cannot access information outside their own chain.

Oracle — SmartViewAI

Oracle: A service that brings external data onto a blockchain, since smart contracts cannot access information outside their own chain.

The problem

A smart contract can only see data on its own chain. It cannot check an asset price, a match result, or the weather. Yet many useful contracts depend on exactly that kind of external fact.

An oracle is the bridge for information rather than assets: a service that publishes external data on-chain so contracts can read it.

Why this is hard

The difficulty is that a blockchain's guarantees stop at the oracle. A contract can execute flawlessly on data that is wrong, and the result is final. Securing the data becomes as important as securing the contract.

The oracle problem in practice

Oracle manipulation has been a recurring attack. The pattern: an attacker moves the price on a thin market that an oracle reads, then exploits a lending protocol relying on that price — borrowing against inflated collateral, or triggering liquidations that pay them.

This is why serious protocols use aggregated feeds drawn from many sources with outlier rejection, rather than reading a single market. A protocol using a single thin market as its price source has a known vulnerability regardless of how good its own code is.

Types

  • Price feeds — the most common, underpinning lending and derivatives.
  • Randomness — verifiable random numbers, since blockchains are deterministic and cannot generate randomness safely.
  • Event outcomes — for prediction markets and insurance.
  • Cross-chain state — reporting what happened on another chain.

What to check

  1. How many independent sources feed the price a protocol relies on.
  2. How frequently it updates, and what happens if it stalls.
  3. Whether there is a fallback if the primary oracle fails.
  4. Whether the markets feeding it are deep enough to resist manipulation.

For anyone depositing into a lending protocol, the oracle design is a more important risk than the advertised yield — and it is documented, if you look.

Push versus pull

Oracles publish data in two broad ways. A push oracle writes updates on-chain at intervals or when the price moves past a threshold, so contracts read a stored value. A pull oracle provides a signed price that the user supplies with their transaction, verified on-chain at the point of use.

Push oracles cost gas continuously but are simple to consume. Pull oracles are cheaper to operate and put freshness in the hands of whoever submits the transaction. The trade-off affects how stale a price can be when a contract acts on it, which is exactly what matters during fast moves.

Staleness and circuit breakers

A well-designed integration checks how old the oracle value is before acting on it, and refuses to proceed if the data has not updated recently. Protocols that omit this check have been exploited when a feed stalled and continued reporting a price that no longer reflected reality.

Some protocols also implement circuit breakers that halt activity when a price moves further or faster than a threshold. These prevent the worst outcomes at the cost of interrupting normal use, which is a reasonable trade in lending markets where the alternative is bad debt.

Related terms

Educational content, not financial or tax advice. Indian tax rules change — confirm your position with a qualified chartered accountant.

Put your knowledge to work

SmartViewAI's AI portfolio tracker applies concepts like Oracle, TVL analysis, and risk scoring to your actual holdings. See your portfolio with fresh eyes.

Educational Content Only. Not Financial Advice.

This glossary entry is published for educational purposes only. It does not constitute financial, investment, or tax advice. Always do your own research before making any crypto investment decisions.