Every lending protocol, perpetual DEX, and options platform on Solana depends on one critical piece of infrastructure: oracles. Without them, smart contracts have no idea what anything is worth. They cannot liquidate an undercollateralized loan, settle a futures contract, or calculate the value of a liquidity position. Oracles are the bridge between real-world data and on-chain logic, and the quality of that bridge determines whether DeFi works or breaks.
This guide explains what oracles are, how the major oracle providers on Solana work, why oracle design matters more than most people realize, and how different DeFi protocols choose and use their price feeds.
What Is a Blockchain Oracle?
A blockchain oracle is a service that delivers external data to smart contracts. Blockchains are deterministic systems -- they can only process data that exists on-chain. They cannot natively access stock prices, weather data, sports scores, or even the price of SOL on a centralized exchange.
Oracles solve this by fetching data from external sources, validating it, and publishing it on-chain where smart contracts can read it. For DeFi, the most important oracle use case is price feeds: reliable, timely prices for tokens, commodities, and other assets.
The challenge is trust. If a single entity controls the oracle, they control the data that DeFi protocols rely on. A compromised oracle can cause billions in incorrect liquidations or enable exploits. This is why oracle design -- how data is sourced, aggregated, and validated -- is one of the most consequential infrastructure decisions in DeFi.
How Oracle Price Feeds Work
At a high level, oracle price feeds follow this process:
- Data sourcing -- prices are collected from multiple sources (exchanges, market makers, data providers)
- Aggregation -- individual data points are combined into a single price, typically using a median or weighted average to filter outliers
- Publication -- the aggregated price is written to an on-chain account that smart contracts can read
- Confidence/deviation metrics -- alongside the price, oracles publish metadata about data quality (confidence intervals, number of sources, staleness)
The differences between oracle providers come down to how each step is implemented, who participates, and how fast the data reaches the chain.
Pyth Network: First-Party Data at Sub-Second Speed
Pyth Network is the dominant oracle on Solana, and it takes a fundamentally different approach from traditional oracles. Instead of sourcing data from public APIs and on-chain DEXs, Pyth gets its prices directly from market participants: exchanges, trading firms, and market makers who have firsthand access to price data.
How Pyth Works
Pyth operates on a publisher model:
| Component | Role |
|---|
| Publishers | Market makers, exchanges, and trading firms that submit price data |
| Aggregation | On-chain program combines publisher inputs into a single price |
| Consumers | DeFi protocols that read the aggregated price |
| Confidence interval | Statistical measure of price certainty published alongside each price |
Each publisher submits their observed price and a confidence interval for each asset. The Pyth program aggregates these using a stake-weighted median, filtering out outliers. The result is a price feed that updates multiple times per second.
Why First-Party Data Matters
Traditional oracles scrape prices from exchange APIs. This means the oracle is always at least one step removed from the actual price discovery. Pyth eliminates this lag by getting data from the entities that are making the markets.
The practical impact is speed. Pyth prices on Solana update every 400 milliseconds -- roughly every Solana slot. For a perpetual DEX that needs to liquidate positions before losses exceed collateral, this sub-second update frequency is the difference between a functioning market and insolvency.
Pyth's Cross-Chain Expansion
Pyth is no longer Solana-only. Through Pythnet (a dedicated appchain) and Wormhole, Pyth price feeds are available on 50+ chains. But Solana remains the primary consumption chain, and Pyth's design was fundamentally shaped by Solana's speed and low cost.
The Confidence Interval
One of Pyth's most important features is the confidence interval published with every price. If SOL is trading at $150 with a confidence interval of $0.10, smart contracts know the price is tight and reliable. If the confidence interval widens to $5.00, something unusual is happening -- low liquidity, exchange outages, or rapid price movement.
Sophisticated DeFi protocols use this confidence data to adjust their behavior. A lending protocol might pause liquidations when confidence intervals are wide, preventing cascading liquidations based on unreliable prices.