Contract Details
Tech Stack
Solidity ^0.8.24 OpenZeppelin v5 Foundry
Chains
Ethereum Arbitrum Base Optimism
Description
Multi-source oracle aggregation contract with outlier detection and fallback logic. Combines prices from Chainlink, Uniswap TWAP, Redstone, and custom feeds. Configurable median/mean strategies, staleness checks, and circuit breakers for each source.
Features
- ✓ Aggregate up to 7 oracle sources
- ✓ Median and weighted-mean strategies
- ✓ Outlier detection (configurable Z-score threshold)
- ✓ Per-source staleness and deviation checks
- ✓ Circuit breaker on source failure
- ✓ Fallback source priority ordering
- ✓ Chainlink, TWAP, Redstone adapters
- ✓ ReentrancyGuard + Ownable2Step
- ✓ Gas-optimized aggregation loop
- ✓ Full Foundry test suite
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title Oracle Aggregator /// @notice Multi-source price aggregation with outlier detection and circuit breakers. contract OracleAggregator { address public immutable owner; uint256 public constant VERSION = 1; event Initialized(address indexed deployer); constructor() { owner = msg.sender; emit Initialized(msg.sender); } // ... full implementation in purchased package }