DEX trades, lending liquidations, and many automations depend on something blockchains can’t do alone: see the outside world. That connection is the job of oracles — the pipelines that bring prices and other facts on-chain, safely and on time. If they work, users barely notice. If they don’t… everyone notices.

What’s inside

  • What an oracle is
  • Why oracles matter
  • Types of oracles you’ll meet in DeFi
  • How a price actually gets on-chain
  • Risks (yes, they’re real) and common mitigations
  • FAQ & Glossary

One-Minute Definition: What is an Oracle

💡 An oracle connects a blockchain to off-chain data (e.g., asset prices, FX, weather, sports). Because smart contracts can’t query the internet directly, they read from oracle-powered data feeds published on-chain. 

The classic oracle problem is getting reliable data without re-introducing a single trusted middleman. 

Why Oracles Matter on a DEX

  • Traders get fairer execution when reference prices are robust, reducing slippage surprises in volatile moments.
  • Lenders/borrowers rely on sane liquidation thresholds — bad oracles are how good positions get wrecked.
  • LPs prefer pools that aren’t exposed to oracle games: healthy oracles = healthier fee flow.
  • Add the Telegram UX (Wallet + mini-apps), and reliable oracles become the quiet engine behind mainstream-ready DeFi flows on TON.
💡 Rule of thumb: in DeFi, you typically want decentralized, aggregated, and frequently updated price feeds.


Types of Oracles (and why you’ll hear these words)

TL;DR: These aren’t buzzwords; they’re the knobs and dials you’ll touch when sanity-checking how a TON dApp gets its prices.

  • By trust model
    • Centralized: one operator curates data; simple, but a single point of failure.
    • Decentralized oracle networks (DONs): multiple independent nodes source/aggregate data → on-chain reference; higher fault tolerance and transparency.
  • By direction
    • Inbound: off-chain → on-chain (most DeFi price feeds).
    • Outbound: on-chain → off-chain (e.g., triggering a payout or a message to a web2 system).
  • By interface
    • Software: APIs, web data, exchange price endpoints.
    • Hardware: sensors, cameras, RFID — less common in DeFi, big in real-world assets/IoT.


How a Price Reaches a TON Smart Contract

  1. Data sourcing: independent oracle nodes pull prices from multiple exchanges/venues.

  2. Aggregation & signing: nodes compute a robust median/weighted value and sign it.

  3. On-chain read on TON:
    • With push: the oracle posts the latest price to a reference contract your app reads. (E.g., Pyth feeds on TON.)
    • With on-demand: your transaction carries a recent signed price payload; the contract verifies it and proceeds (minimizing idle writes). 

Either way, well-designed apps check freshness (max age), deviation thresholds (big jumps need confirmation), and keep fallbacks. 

💡 Think of many thermometers in a room — one thermometer can be wrong; a well-designed average is harder to fool.


Risks & mitigations

  • Price oracle manipulation
    Attackers try to move a thin market (or an ill-designed in-house “oracle”) to trigger unfair liquidations or drains.
    • Mitigations: multiple data sources, robust aggregation/medians, volume-weighted inputs, TWAPs, and circuit breakers.

  • Liveness / latency / staleness
    If feeds update too slowly or halt, contracts may act on old data.
    • Mitigations: heartbeats/deviation triggers, “max age” checks, fallback feeds.

  • Governance & operator risk
    Who can change feed parameters? Who runs nodes?
    • Mitigations: on-chain governance, transparency, and multi-sig/change delays. 


FAQ

❓ Are oracles fully trustless?
Not 100%. You still trust a process (aggregation, node ops). The goal is to minimize subjective trust via decentralization, transparency, and verifiable signatures. 

❓ Why not read prices from a single DEX?
Single sources are gameable; multi-venue aggregation is far harder to manipulate.

❓ Push vs on-demand—what should I pick?
Push is simple for readers; on-demand reduces idle writes and suits TON’s efficiency goals. Many apps support both (push primary, on-demand fallback), depending on the oracle.


Glossary

Oracle — system that brings off-chain data on-chain.

Data feed — on-chain contract exposing a current aggregated value.

TWAP — time-weighted average price; smooths short-term spikes.

Liveness — feed keeps updating; staleness — it doesn’t.

Read also: All you need to know about price impact on decentralized exchanges
Share this article: