FX Engine Quote & Execution Flow
Complete technical specification of the Ratio FX Engine — the core processing pipeline that handles every FX swap and RFQ request on the Ratio platform. Covers the full lifecycle from initial request intake through oracle aggregation, risk state evaluation, pricing construction, quote issuance, and final atomic settlement on the Kaia blockchain.
| Document Version | v1.1 — Updated per design review |
| Status | Internal Review |
| Chain | Kaia Blockchain |
| Initial Corridors | USD-IDR · USD-SGD · MYR-IDR |
| Classification | Confidential |
Design Philosophy
Ratio's FX Engine is designed to mirror the behaviour of an institutional FX dealer desk — using oracle-based pricing, rules-based spread construction, and inventory-aware mid-rate adjustment — rather than an AMM curve. The goal is predictable, institutionally acceptable execution for PSPs and remittance operators, with zero AMM slippage and full auditability on-chain.
Nine-Layer Processing Pipeline
| # | Layer | Purpose |
|---|---|---|
| 1 | Request Entry & Quote Type | Classifies request as Indicative or Firm and routes accordingly |
| 2 | Direction Pre-Filter | Validates trade direction is permitted under current state |
| 3 | Size Check & External RFQ | Validates size; splits tranches; routes oversized to External RFQ |
| 4 | Corridor Routing | Routes to corridor book; MYR-IDR two-step evaluation |
| 5 | Oracle Aggregation | Aggregates Pyth + Orakl + Web2; validates freshness and deviation |
| 6 | State Engine | Evaluates volatility; assigns NORMAL/PROTECT/RESTRICT/HALT |
| 7 | Pricing Engine | Inventory-skewed mid-rate + four-component spread |
| 8 | Arbitrage Validation | Three-layer arb checks before quote issuance |
| 9 | Execution & Settlement | Atomic on-chain settlement, WAOP recording, audit trail |
Flow Diagram
100% · Ctrl+Scroll to zoom · Drag to pan
Corridor Reference — Phase 1
| Corridor | Type | Base Spread | Oracle Max Age | Route | Stablecoins |
|---|---|---|---|---|---|
| USD-IDR | G10 → Asia EM | 3–4 bps | 20 seconds | Direct Book | USDT / IDRX |
| USD-SGD | G10 → G10 Deep | 1–2 bps | 30 seconds | Direct Book | USDT / tnSGD |
| MYR-IDR | Asia EM → Asia EM | 5–6 bps | 15 seconds | Direct or Synthetic via USD | MYRC / IDRX |