Ratio’s pricing is anchored to real-world FX rates from institutional-grade oracle feeds. The oracle infrastructure is designed for reliability, accuracy, and redundancy — ensuring every quote reflects current market conditions.Documentation Index
Fetch the complete documentation index at: https://docs.ratiofx.com/llms.txt
Use this file to discover all available pages before exploring further.
Oracle architecture
Oracle Keeper service
Fetches prices from external sources and pushes them to the on-chain Oracle Aggregator contract.
Oracle Aggregator contract
Validates, aggregates, and stores the latest prices on-chain. Single source of truth.
The FX Engine never reads oracle prices directly from external sources. All prices flow through the on-chain aggregator, ensuring a single source of truth with full auditability.
Pyth Network (primary source)
Pyth Network is Ratio’s primary oracle. Key characteristics:| Property | Value |
|---|---|
| Update frequency | ~400 milliseconds |
| Coverage | 380+ price feeds including FX pairs |
| Data quality | Each price includes a confidence interval |
| Data sources | Professional market makers and trading firms |
| On-chain availability | Available on Kaia via Pyth contract + Hermes API |
Web2 FX API (fallback source)
For redundancy, Ratio integrates traditional Web2 FX data providers as fallback sources. These are used when the primary oracle is unavailable or when an independent reference is needed for validation. The Web2 adapter is pluggable — the system can switch between providers without changing core logic.Price validation
Every oracle price is validated before use:| Check | What it verifies | Failure response |
|---|---|---|
| Freshness | Is the price recent enough? Each corridor has a maximum acceptable age. | Approaching staleness → wider spreads. Stale → circuit breaker. |
| Source consistency | Do multiple sources agree? | Minor divergence → caution mode. Major divergence → halt. |
| Reasonableness | Does the price fall within expected bounds? | Out of bounds → halt and alert. |
Cross-currency rate construction
For pairs without a direct oracle feed (e.g., MYR/IDR), the system constructs a reference rate:Reliability design
Multiple sources
Independent oracle providers prevent single-point-of-failure dependency.
On-chain aggregation
Oracle data is immutably recorded and auditable on Kaia.
Automatic failover
Switches between sources based on freshness and reliability.
Circuit breakers
Halts trading rather than executing at unreliable prices.