Calix Chain

Price Oracle

CalixOracle is a Chainlink AggregatorV3Interface-compatible price feed with multi-feeder median aggregation and TWAP support. Any Chainlink-aware protocol works with it out of the box.

Design

Key Functions

FunctionAccessDescription
submitPrice(int256 price)feederSubmit price for the current round
twap(uint256 window)publicReturn time-weighted average price over window seconds
latestRoundData()publicChainlink-compatible latest answer + metadata
getRoundData(uint80 id)publicHistorical round data by ID
resetCircuitBreaker()ownerResume submissions after a circuit-breaker trip
addFeeder(address)ownerApprove a new price feeder address

Consuming the Oracle in Solidity

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

AggregatorV3Interface feed = AggregatorV3Interface(oracleAddress);
(, int256 price,,,) = feed.latestRoundData();
// price is scaled by 10 ** feed.decimals()

Querying TWAP

// Get 1-hour TWAP
ICalixOracle oracle = ICalixOracle(oracleAddress);
int256 twapPrice = oracle.twap(3600);
💡
Best practice. Set minSubmissions to at least 3 for production feeds. A single feeder can be compromised or go offline; majority agreement provides meaningful manipulation resistance. Use the circuit breaker threshold as a secondary safety net, not the primary one.
âš ī¸
Circuit breaker resets. The circuit breaker pauses all new submissions when it trips. Investigate the root cause before calling resetCircuitBreaker() — a compromised feeder should be removed via removeFeeder first.
â„šī¸
Oracle contract addresses will be published on Calix Scan at mainnet launch.