Skip to main content

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.

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.

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

System Architecture Ratio consists of three layers:
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
All settlement data is recorded on-chain, providing an immutable audit trail for every transaction.
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
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
Partners request quotes, execute swaps, and receive settlement confirmations without interacting with the blockchain directly.

How the layers interact

A typical swap flows through all three layers:
1

Partner requests a quote

Via the REST API (integration layer).
2

Backend constructs the quote

Fetches oracle prices, checks risk conditions, builds spread (off-chain layer).
3

Partner accepts the quote

Submits execution request via the API.
4

Swap executes atomically on Kaia

Source pool debited, destination pool credited, fees distributed (on-chain layer).
5

Settlement confirmation returned

Via API response and/or webhook callback.
The entire flow completes in seconds. From the partner’s perspective, it’s a single API call that returns a confirmed settlement.

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.