Aggregation Engine
The Multi-Resource Aggregation Core transforms raw data from Multi Sources into a single, manipulation-resistant price. This page covers the complete pipeline: ingestion, validation, filtering, and deterministic aggregation.
1. Data Ingestion
To prevent single-point failures and ensure accuracy, we ingest three distinct categories of data:
DEX TWAP Feeds
Sources: Uniswap V3, Curve, Balancer
Method: Time-Weighted Average Prices with liquidity-derived weighting
Benefit: Manipulation-resistant baseline rooted in on-chain capital
Signed Off-Chain Feeds
Sources: Binance, Coinbase, Kraken, OKX
Method: Cryptographically signed price updates
Benefit: High-frequency updates verified against Source Registry
On-Chain Health Signals
Metrics: Liquidity pool depth, utilization rates, protocol pause states
Method: Direct blockchain queries
Benefit: Real-time health awareness alongside price data
2. Validation & Filtering
Raw data is never trusted blindly. Every input must pass multiple validation checks before entering the consensus round.
Normalization
- Decimal Standardization: All values converted to 18-decimal fixed-point (Wad)
- Canonical Timestamps: Normalized to UTC milliseconds for precise correlation
- Unified Schema: Heterogeneous sources transformed to common format
Source Validation
- Signature Verification: Off-chain feeds validated against registered public keys
- Active Status: Only sources marked active in SourceRegistry are accepted
- Error Handling: Sources reporting errors or timeouts are automatically excluded
Outlier Detection
🚫 The following inputs are automatically rejected:
- Statistical Outliers: Prices deviating significantly from group median (Z-score analysis)
- Stale Data: Timestamps older than 500ms acceptance window
- Low Liquidity: Price moves not supported by sufficient order book depth
- Wash Trading Patterns: High volume with zero price displacement
3. Consensus & Aggregation
Quorum Enforcement
A price update cannot be published without sufficient participation:
- Minimum Threshold: At least 67% of valid sources must report
- Abort Condition: If quorum is not met, the round is blocked entirely
- Safety Guarantee: Prevents any single compromised source from affecting output
Liquidity-Weighted Median (LWM)
Unlike simple medians that treat all sources equally, we weight by actual market liquidity:
Price_Final = Σ( Price_i × Weight_i ) / Σ(Weights)
Where Weight_i = f(OrderBook_Depth_2%, Volume_24h, Reliability_Score)This ensures that a $10M order book on Binance influences the final price more than a $1k pool on a low-liquidity DEX.
Deterministic Output
✓ Guarantee: Identical sets of input data will always produce the exact same output. This determinism is essential for verifying oracle integrity and enabling on-chain dispute resolution.
4. Final Output
After successful aggregation, the engine produces:
| Field | Description |
|---|---|
price | Aggregated price with 18 decimals |
confidence | Data quality score (0-100) |
riskLevel | LOW | MEDIUM | HIGH | CRITICAL |
timestamp | Unix timestamp of aggregation |
sources | Count of sources used in round |
This data is then passed to the on-chain contracts for verification and storage. See Smart Contracts for details.
