What are onchain trading data feeds?
Published 10/23/2026, 12:24:45 AM
Onchain trading data feeds fall into two complementary families, and the term is used for both:
- Feeds that bring external data onto a blockchain — "oracle" price feeds (Chainlink, Pyth, API3) that smart contracts read to price trades, value collateral, and liquidate positions. This is the dominant meaning in DeFi.
- Feeds that take blockchain data off and organize it — indexers and analytics layers (The Graph, Dune, Goldsky, Moralis) that decode raw blocks into queryable tables/APIs used for research, trading dashboards, and analytics.
A useful rule of thumb: exchange feeds answer "what is the price and how much is trading?" Onchain feeds answer "what settled, who moved it, and where did it go?" — neither substitutes for the other (Allium).
How oracle price feeds work (external data → onchain)
Chainlink's documentation describes a decentralized oracle network (DON) where "each data feed is updated by a decentralized oracle network" and "each oracle operator is rewarded for publishing data," with an aggregator contract that "must receive responses from a minimum number of oracles" before forming "the feed's latest and trusted answer" (Chainlink docs).
The standard pipeline has three (sometimes four) stages:
| Stage | What happens | Example source |
|---|---|---|
| 1. Source aggregation | Premium data providers pull raw prices from many CEXs/DEXs, weighting for time, volume, and outliers | Chainlink |
| 2. Oracle network aggregation | Independent node operators each fetch from providers; results are combined, typically via median, to resist any single bad actor | Chainlink, smartcontractaudit.com |
| 3. Offchain Reporting (OCR) | Nodes sign observations offchain, submit one aggregate transaction verified onchain against quorum signatures | Chainlink docs |
| 4. Onchain publication & consumption | The aggregate is stored in a reference contract; consumer contracts read it via latestRoundData() through a proxy address | Chainlink docs, Robinhood Chain docs |
Update triggers are configurable: a deviation threshold (e.g., update fires if the price moves 0.05% since last update) and a heartbeat (a maximum time interval). This balances data freshness against onchain gas costs (Chainlink blog). Feed types include price feeds, L2 sequencer uptime feeds, proof-of-reserve, and self-managed feeds (Chainlink docs); not all feeds are equal — some are single-source or onchain-sourced, with correspondingly higher pricing risk (Chainlink docs).
Economic security is central: oracles stake tokens that can be slashed for dishonest reports ("nodes that deviate too far get slashed" per dev.to). Even so, manipulation is possible under specific conditions — e.g., flash-loan attacks against illiquid feeds or stale answers — which is why freshness checks and quality-tier selection matter (dev.to).
Push vs pull oracles — the two main designs
- Push-based (Chainlink feeds): the oracle continually updates the onchain price on a schedule/threshold; contracts just read it. Chainlink's "push-based oracle... delivers offchain data to a blockchain network on a predefined schedule (e.g., every minute)" (Chainlink education). Pyth's Solana v1 was also push, publishing updated prices "at every slot or every 400ms" (Pyth).
- Pull-based (Pyth Core): the oracle publishes signed updates offchain (via its Hermes service) and users submit them onchain only when needed — pay gas only on use. Per Pyth docs: "(1) fetch signed price data from the off-chain Hermes service, (2) submit it to the on-chain Pyth contract for verification, and (3) read the verified price." Pyth is first-party — 120+ publishers include major exchanges/trading firms/market makers — and claims 500+ feeds with ~400ms update latency across 100+ chains (Pyth docs, Ronin docs).
How indexer/analytics feeds work (onchain → queryable data)
A blockchain indexer "reads raw onchain data (blocks, transactions, event logs, traces) and transforms it into structured, queryable database tables" (SQD). Two dominant models:
- The Graph (subgraphs): "A Subgraph is a custom, open API that extracts data from a blockchain, processes it, and stores it so it can be easily queried via GraphQL" (The Graph docs). Indexers stake GRT and can be slashed for inaccurate data; users pay in GRT for queries (Conduit).
- Dune: indexes 100+ chains into raw tables —
blocks,transactions, (event)logs, (call)traces— then decodes popular contracts via verified ABIs into separate event/call tables, plus curated abstraction tables (e.g.,dex, lending) (ethereum.org, Dune). Analysts query with DuneSQL, a Trino fork (Gate Learn); Dune claims 3+ PB of data (Dune docs). Goldsky and Moralis instead serve REST/streaming feeds: "wallet feeds return transfers and balances for any address, with USD values and token metadata already filled in" (Goldsky), or "every block turned into balances, transfers, swaps, prices... as a real-time stream" (Moralis).
Market snapshot of the major feed protocols (as of 2026-10-23)
| Protocol | Model | Price | Market cap | Notable mechanics |
|---|---|---|---|---|
| Chainlink (LINK) | Push oracle feeds + CCIP + Data Streams | $11.97 | $9.18B | DONs with LINK staking/slashing; powers most DeFi pricing (chain.link) |
| Pyth (PYTH) | Pull oracle, first-party publishers | $0.0721 | $0.568B | Oracle Integrity Staking; ~400ms updates (pyth.network) |
| API3 (API3) | First-party oracle (Airnode) | $0.2633 | $38.8M | API providers run their own nodes; staking as service collateral (api3dao) |
| The Graph (GRT) | Decentralized indexer (subgraphs/GraphQL) | — | — | Indexers stake GRT, slashed for inaccurate data (thegraph.com) |
| Dune | Analytics warehouse (DuneSQL) | — | — | 100+ chains, raw → decoded → curated tables (dune.com) |
Prices/mcaps from token-discovery lookup at query time; LINK and PYTH tickers were the only feed-protocol tokens with full market data returned.
Bottom line: if you're building a trading dApp, an onchain data feed is the trust bridge — either price oracles that push/pull consensus-verified market prices into contracts your protocol can read, or indexers/analytics that turn raw chain activity into queryable tables and APIs. The oracle's job is verifiable ingestion of external truth; the indexer's job is organized retrieval of internal chain state. Decentralization (multiple sources, median aggregation, staking/slashing) is what separates a "feed" from a single server telling a contract what to do.
Gaps/limits: this is a conceptual explainer — I did not pull live onchain feed freshness or per-pair data (e.g., specific Chainlink feed addresses and their update times), and market prices are a point-in-time snapshot, not a recommendation.