Layer 5 — Oracle Aggregation & Validation
The Oracle layer is the single source of truth for all FX reference rates. It mirrors institutional FX desks that consume multiple independent price feeds and validate them against each other before trusting any single source.
Oracle Sources
| Source | Type | Update Frequency | Role |
|---|---|---|---|
| Pyth Network | Web3 — Push-based | ~400ms | Primary source; institutional-grade FX data on-chain |
| Orakl Network | Web3 — Pull-based | On-demand | Primary source; Kaia-native oracle with corridor-specific feeds |
| Bloomberg / XE | Web2 — REST API | Periodic | Backup source only; used when both Web3 sources deviate beyond threshold |
Aggregation Logic
Under normal conditions, the Oracle Aggregator computes a weighted mid-rate using Pyth and Orakl at equal 50% weighting. Web2 is activated only when Pyth and Orakl deviate from each other beyond a configured threshold, at which point it acts as a tiebreaker reference.
Aggregated Mid = (Pyth Price × 0.50) + (Orakl Price × 0.50)
Freshness & Deviation Validation
| Corridor | Max Oracle Age | Max Deviation | Rationale |
|---|---|---|---|
| USD/SGD, USD/JPY | 30 seconds | 0.10% | Deep G10 pairs; moves are gradual and well-covered by both sources |
| USD/IDR, USD/MYR | 20 seconds | 0.15% | EM managed-float; central bank interventions can cause sudden moves |
| MYR/IDR (cross) | 15 seconds | 0.20% | Synthetic cross; cumulative deviation risk from both legs requires tighter freshness |
Validation Outcomes
| Validation Result | Action Taken |
|---|---|
| Valid — fresh and within deviation | Aggregated mid-rate passed to State Engine |
| Warning — near threshold but not breached | Mid-rate passed downstream; State Engine receives PROTECT signal |
| Stale — oracle age exceeds max threshold | Circuit Breaker triggered; State set to HALT; no quote issued |
| Deviation Breach — sources diverge beyond max | Circuit Breaker triggered; State set to HALT; no quote issued |