What is Price Oracle?

1 min read Updated

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.

FREQUENTLY ASKED QUESTIONS

Why not just use exchange prices?
Smart contracts can't access off-chain data. Oracles bridge this gap. On-chain oracles (TWAPs) don't need external data but are slower. Off-chain oracles (Chainlink) need trust in the data providers.
How are oracle attacks executed?
Typically: flash loan a large amount → manipulate a thin liquidity pool that an oracle references → trigger favorable liquidation/trade → repay flash loan. All in one transaction.
What is a TWAP oracle?
Time-Weighted Average Price — averages on-chain prices over a period (e.g., 30 minutes). More manipulation-resistant than spot prices but introduces a lag. Used by Uniswap and some lending protocols.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.