Ratio uses a hybrid architecture — combining the trust and auditability of on-chain settlement with the performance and flexibility of off-chain orchestration. Partners experience instant settlement; inventory management and risk monitoring happen behind the scenes.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.
Design philosophy
Ratio’s FX Engine mirrors how institutional FX dealer desks operate — using oracle-based pricing, rules-based spread construction, and inventory-aware mid-rate adjustment — rather than an AMM bonding curve. The goal is predictable, institutionally acceptable execution with zero AMM slippage and full on-chain auditability.The architecture separates the user experience (instant settlement) from market execution (inventory management). Partners always receive instant, atomic settlement regardless of the protocol’s internal inventory position.
Architecture layers
On-chain layer (Kaia blockchain)
On-chain layer (Kaia blockchain)
Handles everything that requires trust and immutability:
- Swap execution — Atomic FX swaps that settle in a single transaction
- Pool accounting — Stablecoin pool balances, LP token management, and fee distribution
- Oracle price feeds — Real-time FX rates from institutional-grade oracles pushed on-chain
- LP token mechanics — kToken minting, burning, and auto-compounding of swap fee rewards
Off-chain layer (backend services)
Off-chain layer (backend services)
Handles everything that requires speed and flexibility:
- FX quote construction — Multi-step pricing pipeline that fetches oracle rates, evaluates risk conditions, constructs spreads, and issues executable quotes
- Risk monitoring — Continuous evaluation of oracle health, market volatility, pool inventory, and system exposure
- Inventory rebalancing — Coordination with external market makers to restore pool health when imbalances exceed thresholds
- Partner and configuration management — Partner credentials, fee schedules, corridor parameters, and operational controls
Partner integration layer (API)
Partner integration layer (API)
Partners interact with Ratio through a REST API that abstracts all internal complexity. The API supports:
- Two quote types (indicative and firm)
- Webhook-based event notifications
- Real-time system health queries
- Full fee transparency in every response
How the layers interact
A typical swap flows through all three layers:Backend constructs the quote
Fetches oracle prices, checks risk conditions, builds spread (off-chain layer).
Swap executes atomically on Kaia
Source pool debited, destination pool credited, fees distributed (on-chain layer).
Smart contract architecture
Ratio’s on-chain components are deployed as purpose-built smart contracts on Kaia. The contracts handle swap execution, pool management, fee collection and distribution, oracle price aggregation, and LP deposit/withdrawal accounting. All contracts are upgradeable and configurable — pool parameters, fee schedules, and operational thresholds can be updated without redeploying contracts or interrupting service.Scalability
New corridors
Adding a currency pair requires only configuration (oracle feeds, pool parameters, fee tiers). No code changes or contract deployments.
New stablecoins
Each stablecoin gets its own pool. Adding a stablecoin is an operational task, not an engineering one.
Volume growth
The off-chain pricing engine handles quote construction independently of on-chain throughput. Kaia’s sub-second blocks support high transaction volumes.
Partner growth
Partner-specific configuration (fee overrides, corridor access, volume limits) is managed without protocol changes.