Every time you swap tokens on an exchange, borrow against collateral, or check an asset’s value, you’re relying on live data from somewhere. Most people never think about how that number shows up. They just assume they’re accurate and move on.
That assumption holds up most of the time. When it breaks, you lose money before you realize the numbers were off.
Understanding how price feeds work helps you avoid those situations and pick platforms that take the infrastructure seriously.
TL;DR
- Price feeds aggregate data from centralized exchanges like OKX, Binance, and Kraken to create a single reference price.
- The best feeds use median or volume-weighted averages and update in real time to resist manipulation.
- Major exchanges like OKX provide real-time API feeds that oracle networks use as trusted data sources.
What does a price feed do?
A crypto price feed is a data stream that reports the current market price of an asset. Exchanges need it to show you live prices. DeFi protocols need it to settle loans, trigger liquidations, and execute automated trades. Wallet apps need it to display your portfolio value.
The challenge is that crypto markets are rather fragmented. Bitcoin trades on hundreds of exchanges at hundreds of slightly different prices. No single official number exists, so price feeds aggregate data from multiple sources, apply some kind of filtering or weighting, and output a single reference price.
The quality of that aggregation separates a reliable feed from one that breaks when you need it.
Where do the numbers come from?
Most price feeds pull data from centralized exchanges such as Binance, Coinbase, Kraken, and OKX. Those platforms handle the bulk of trading volume and publish price data through APIs. A feed provider queries those APIs, collects the most recent trade prices or order book midpoints, and calculates an average or median.
Some feeds also pull from decentralized exchanges like Uniswap or Curve, though liquidity on DEXs is typically lower and prices can be more volatile. The best feeds combine both types of sources to reduce the risk that a single market anomaly throws the number off.
The exchanges themselves also aggregate. The ADA price feed on OKX, for example, reflects trading activity across multiple OKX order books and trading pairs, weighted by volume for accuracy.
How feeds calculate a single price
Price feeds use different aggregation methods.
A simple average takes all the prices and divides by the number of sources. That works fine if every source is equally reliable, but it falls apart when one exchange has thin order books or gets manipulated.
A weighted average gives more influence to exchanges with higher trading volume. That makes sense in theory but introduces new problems if the volume data itself is unreliable or if a single exchange dominates the weighting.
A median price takes the middle value from the set of reported prices, which filters out extreme outliers but can lag the market during rapid moves if half the sources are stale.
The best feeds use volume-weighted medians or time-weighted averages with circuit breakers that flag extreme moves and pause updates until a human or smart contract reviews them. That approach is more complex but also more resistant to manipulation.
Speed matters more than you think
A price feed that updates once a minute is already outdated by the time it posts. High-frequency trading relies on millisecond precision. DeFi protocols liquidating collateral need updates every few seconds at a minimum.
The gap between when a price changes on the exchange and when the feed reflects it is called latency. Low latency matters most when you’re trading or when your position is close to a liquidation threshold.
Some feeds update continuously in real time. Others batch updates every few seconds or every block, depending on the blockchain they serve. On Ethereum, for example, updating a price onchain costs gas, so feeds balance freshness against cost.
Chainlink, one of the larger oracle networks, uses a threshold system where the feed only updates if the price moves by more than a set percentage or a certain amount of time passes. That saves gas but introduces lag during volatile periods.
Onchain vs. offchain oracles
Price feeds can run entirely offchain, where a centralized API serves the data to whoever requests it, or they can be pushed onchain, where smart contracts can read them directly.
Offchain feeds are faster and cheaper to update. They’re the standard for centralized exchanges and most trading platforms. You query the API, get the price, and use it.
Onchain oracles publish price data to a blockchain so smart contracts can access it. DeFi protocols need onchain feeds because they can’t make external API calls. The feed has to exist as a contract on the chain where the protocol runs.
The tradeoff is cost and speed. Publishing to Ethereum during high gas periods can get expensive, so onchain feeds update less frequently than offchain ones. Some protocols use hybrid models where the feed stays offchain until a smart contract specifically requests an update and pays for it.
Manipulation is the biggest threat
Technical failure is a risk, but manipulation is worse.
If an attacker can move the reported price away from the real market price, they can exploit the gap for profit. On a lending protocol, they could inflate the price of a collateral asset, borrow against it, then let the price crash back to normal and walk away with the loan.
In a flash loan attack, for example, an attacker borrows a huge amount of capital for a single transaction, uses it to manipulate the price on a low-liquidity exchange, tricks a protocol into accepting that price, and pockets the difference before the loan has to be repaid.
Good price feeds resist this by aggregating from multiple sources, weighting by volume, ignoring outliers, and adding time delays that make single-block manipulation harder to execute. Plenty of smaller DeFi projects still use weak oracles, and they get drained because of it.
What makes a feed trustworthy
If you’re using a platform that relies on price data, you want to know where that data comes from and how the platform validates it.
A strong feed pulls from multiple high-liquidity sources, uses a volume-weighted or median aggregation method, updates frequently, and has some kind of circuit breaker for extreme moves. The feed should also be transparent about its methodology so you can verify it yourself.
Platforms that run their own internal price feeds without external validation are at higher risk. If the operator controls the feed, they can manipulate it.
Onchain feeds from established oracle networks like Chainlink or Pyth are safer because the data comes from decentralized node operators rather than a single entity. Major exchanges like OKX also provide oracle services and API feeds that third-party protocols can use, which adds another layer of trust.
You also want to check the update frequency. A feed that updates every 30 seconds might be fine for checking your portfolio balance but terrible if you’re trading derivatives or managing a leveraged position.
The bottom line
Price feed failures tend to happen when markets move fastest or when liquidity dries up. Those are also the moments when you’re most exposed. Knowing how a platform sources its data helps you spot weak infrastructure before it costs you.
Do your own research before trusting any platform with your money. The feed quality might not be the first thing you notice, but when prices move fast or markets turn volatile, good infrastructure is what keeps you solvent








































