Oracle
Provides tamper-resistant price feeds with multi-source aggregation and circuit-breakers.
Path: oracle
Third-party documentation. This is independently authored analysis of the public Aurum Protocol codebase — not the official docs, and not reviewed or endorsed by the Aurum Protocol team.
Oracle Module
Price integrity is critical in a lending protocol. The Oracle module aggregates prices from multiple independent sources and validates them against deviation and staleness thresholds before surfacing them to other modules.
Price Sources (in priority order)
- Chainlink Data Feeds — primary, heartbeat 1 hour, deviation 0.5%
- Uniswap v3 TWAP — secondary, 30-minute window, used if Chainlink is stale
- Custom off-chain feed — tertiary, requires ORACLE_UPDATER_ROLE signature
Circuit Breakers
- Staleness: any feed older than 1 hour is rejected
- Deviation: if two sources disagree by >5%, the lower price is used and an alert event is emitted
- Zero price: a price of 0 always reverts — no position is allowed to be valued at zero
Examples
Fetch ETH price
Fetch ETH price
typescript
const [price, updatedAt] = await oracle.getPrice(WETH_ADDRESS);const age = Math.floor(Date.now() / 1000) - Number(updatedAt);console.log(`ETH: $${(Number(price) / 1e8).toFixed(2)} (age ${age}s)`);
STATUSexample
Price is returned as 1e8 fixed-point (matching Chainlink's native format).
Batch price fetch for health-factor computation
Batch price fetch for health-factor computation
typescript
const assets = [WETH_ADDRESS, USDC_ADDRESS, WBTC_ADDRESS];const [prices] = await oracle.getBatchPrices(assets);assets.forEach((a, i) => {console.log(a, "→", (Number(prices[i]) / 1e8).toFixed(2), "USD");});
STATUSexample
Reduces RPC calls when computing portfolio health-factor across multiple assets.
Edge Cases
- getPrice reverts with StalePrice() if no source has been updated within the staleness window
- getBatchPrices reverts if ANY asset in the array lacks a valid price — atomicity is intentional
- pushPrice requires the message to be signed with a key holding ORACLE_UPDATER_ROLE; replays are blocked by a nonce
- During a Chainlink outage, the protocol automatically downgrades to the Uniswap TWAP source
Interface
Interface
solidity
interface IOracle {/// @notice Returns USD price for asset, scaled to 1e8 (Chainlink convention)function getPrice(address asset) external view returns (uint256 price, uint64 updatedAt);/// @notice Returns prices for multiple assets in one callfunction getBatchPrices(address[] calldata assets)external viewreturns (uint256[] memory prices, uint64[] memory updatedAts);/// @notice Push an off-chain signed price — requires ORACLE_UPDATER_ROLEfunction pushPrice(address asset, uint256 price, bytes calldata signature) external;event PriceFetched(address indexed asset, uint256 price, uint8 source);event PriceDeviation(address indexed asset, uint256 price1, uint256 price2);}
STATUSinterface
