What is Price Oracle?
A price oracle in DeFi is a data feed that supplies real-time asset prices to smart contracts — critical for lending liquidations, derivative settlements, and any on-chain financial calculation.
WHY IT MATTERS
Smart contracts can't check CoinGecko. They need on-chain price feeds — oracles — to know what assets are worth. Lending protocols need prices to determine when to liquidate. DEXs use them for limit orders. Derivatives need them for settlement.
Oracle design matters enormously. Chainlink's decentralized oracle network aggregates data from multiple sources. Uniswap's TWAP (Time-Weighted Average Price) derives prices from on-chain trading. Each has different trust assumptions and manipulation resistance.
Oracle manipulation is one of the most common DeFi attack vectors. Flash loan attacks often target oracle feeds to trigger unfavorable liquidations or trades.