> ## 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.

# How It Works

> End-to-end architecture of the Stablecoin Orchestration Layer

Ratio's Stablecoin Orchestration Layer (SOL) is regulated middleware that sits between stablecoin issuers and the businesses that need to move money. With a single API integration, the SOL abstracts local market complexity and provides end-to-end intelligent liquidity routing, optimised FX swaps, and instant cross-border settlement.

## Core components

<img src="https://mintcdn.com/ratiolabs/_WZ1jJo-JiN7xW7b/images/sol-architecture.svg?fit=max&auto=format&n=_WZ1jJo-JiN7xW7b&q=85&s=e9b350fcca799377b32e0de87fb8a28b" alt="SOL Architecture" width="960" height="460" data-path="images/sol-architecture.svg" />

The SOL consists of six components that work together to provide end-to-end money movement.

<AccordionGroup>
  <Accordion title="On-Ramp">
    Provides seamless, multi-partner fiat-to-stablecoin connectivity across regions. On-Ramp partners — PSPs, banks, and e-wallets — handle end-user KYC and convert fiat deposits into stablecoins that enter the SOL.
  </Accordion>

  <Accordion title="FX Engine">
    The core execution layer. The FX Engine converts between stablecoins using oracle-based pricing from institutional-grade feeds (Pyth Network), delivering near real-world FX rates with tight spreads. Unlike AMM-based DEXs, execution quality does not degrade with transaction size.
  </Accordion>

  <Accordion title="Liquidity Hub">
    Manages stablecoin liquidity across single-sided pools — one pool per currency (USDT, IDRX, tnSGD, MYRC). The Liquidity Hub sources depth from LP deposits and coordinates automated rebalancing to ensure swap availability at all times.
  </Accordion>

  <Accordion title="Yield Engine">
    Deploys idle stablecoin balances into secure yield strategies, maximising return on liquidity that isn't actively being used for FX execution. Yield is distributed to participating LPs with real-time redemption capability.
  </Accordion>

  <Accordion title="Off-Ramp">
    Receives stablecoins from the FX Engine and converts them to local fiat via domestic rails — bank transfer, e-wallet, or card. Off-Ramp partners handle last-mile distribution in each market.
  </Accordion>

  <Accordion title="Communication Layer">
    Standardises data exchange across partners using ISO 20022-inspired message templates for bank info, beneficiary data, and transaction confirmations — enabling reliable, interoperable settlement flows.
  </Accordion>
</AccordionGroup>

## End-to-end transaction flow

<img src="https://mintcdn.com/ratiolabs/_WZ1jJo-JiN7xW7b/images/transaction-flow.svg?fit=max&auto=format&n=_WZ1jJo-JiN7xW7b&q=85&s=ca819dda827d1dd0dc3641c3c04e9749" alt="Transaction Flow" width="680" height="440" data-path="images/transaction-flow.svg" />

A typical cross-border remittance through Ratio follows this path:

<Steps>
  <Step title="User deposits fiat">
    The user deposits fiat (e.g., USD) via an On-Ramp partner — bank transfer or e-wallet.
  </Step>

  <Step title="On-Ramp converts to stablecoin">
    The On-Ramp partner converts the fiat deposit to a stablecoin (e.g., USDT) and deposits it into the SOL.
  </Step>

  <Step title="FX Engine executes the swap">
    The FX Engine exchanges USDT for the destination stablecoin (e.g., IDRX) at oracle-based pricing with an institutional-grade spread.
  </Step>

  <Step title="Atomic settlement on Kaia">
    The swap settles atomically on-chain on the Kaia blockchain in under 1 second.
  </Step>

  <Step title="Off-Ramp converts to local fiat">
    The Off-Ramp partner receives the destination stablecoin (e.g., IDRX) and converts it to local fiat (IDR).
  </Step>

  <Step title="User receives local currency">
    The user receives IDR in their Indonesian bank account or e-wallet.
  </Step>
</Steps>

<Note>
  Total time: seconds to minutes, compared to 1–3 days via legacy rails. Total cost: single-digit basis points, compared to 3–7% via legacy rails.
</Note>

## On-chain and off-chain

Ratio uses a hybrid architecture. Critical settlement and accounting logic lives on-chain on Kaia for auditability and trustlessness, while decision-making and orchestration runs off-chain for performance and flexibility.

<Tabs>
  <Tab title="On-chain (Kaia)">
    * Atomic swap execution and settlement
    * Liquidity pool accounting and LP token management
    * Fee collection and distribution
    * Oracle price feeds
  </Tab>

  <Tab title="Off-chain (backend services)">
    * FX quote construction and pricing logic
    * Risk monitoring and circuit breaker evaluation
    * Inventory rebalancing coordination
    * Partner management and configuration
  </Tab>
</Tabs>

This separation means you always receive instant, atomic settlement. Behind the scenes, the protocol manages inventory and risk asynchronously — the complexity is abstracted away from your integration.

## Explore further

<CardGroup cols={2}>
  <Card title="Corridors" icon="globe" href="/corridors">
    View available currency pairs, supported stablecoins, and the future roadmap
  </Card>

  <Card title="Oracle-based pricing" icon="chart-line" href="/features/oracle-pricing">
    Learn how the FX Engine uses institutional-grade oracles for real-world rates
  </Card>

  <Card title="Liquidity and pools" icon="droplet" href="/features/liquidity-and-pools">
    Understand how single-sided pools provide reliable depth for FX execution
  </Card>

  <Card title="Atomic settlement" icon="bolt" href="/features/atomic-settlement">
    See how every swap settles in a single on-chain transaction with no counterparty risk
  </Card>
</CardGroup>
