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.

Oracle Pricing

Ratio prices every FX swap using real-time data from institutional oracle feeds — not an AMM bonding curve. This means the rate you receive is anchored to the live market, your execution quality does not degrade with transaction size, and there is no arbitrage dependency baked into your pricing.

How it works

Every quote begins with a real-time mid-market rate from professional-grade oracle feeds. The FX Engine then constructs a bid/ask spread around that rate based on current market conditions. The result closely tracks the real-world FX market rather than a synthetically derived curve. Pricing Pipeline The pricing pipeline follows four stages:
1

Oracle aggregation

Ratio fetches and validates real-time FX rates from multiple independent price sources. Every incoming price is checked for freshness and cross-source consistency before being used.
2

Mid-rate adjustment

The mid-rate is adjusted based on current pool inventory. Flows that reduce a pool imbalance are made cheaper; flows that worsen it are made more expensive. This incentivises natural rebalancing without manual intervention.
3

Spread construction

A bid/ask spread is built dynamically from four independent risk components — base, volatility, liquidity, and inventory. The spread reflects actual market conditions at the moment of quoting.
4

Quote issuance

A firm, executable quote is returned with a short expiry window. The rate is locked for the duration of the quote window — what you see is what you get at execution.

Oracle sources

Ratio uses Pyth Network as its primary oracle source. Pyth provides institutional-grade FX price data updated approximately every 400 milliseconds, sourced from professional market makers and trading firms. For redundancy, Ratio also integrates Web2 FX API sources as fallback feeds. If the primary on-chain oracle becomes stale or unavailable, the system falls back to off-chain FX data to maintain continuity. If no reliable source is available, trading halts automatically rather than executing at an unreliable price.
Every oracle price is validated for freshness and cross-source consistency before being used in a quote. Stale data or significant divergence between sources triggers protective measures automatically — see Risk Management for details.

Why not an AMM?

AMM-based DEXs (like Uniswap or Curve) derive price from a mathematical bonding curve based on pool ratios. This creates three problems that make AMMs unsuitable for institutional FX:
ProblemAMM behaviourRatio behaviour
Slippage on sizeLarger trades move the price against the user. A $100K swap gets a materially worse rate than a $1K swap on the same pair.Every quote is anchored to the oracle mid-rate. Execution quality does not degrade with size.
No market anchorAMM prices can drift significantly from real-world FX rates, especially in thin markets.Every quote is derived from live institutional FX data.
Arbitrage dependencyAMMs rely on arbitrageurs to correct mispricing. LPs bear the cost of continuous rebalancing (impermanent loss).Spread components reflect actual risks. No arbitrage dependency.

Spread construction

Ratio’s spread is not a single fixed number. It is constructed from four independent components that each address a distinct real-world risk:
ComponentWhat it reflectsWhen it changes
Base spreadA minimum floor covering operating costsVaries by corridor and transaction size tier — larger trades get a tighter base
Volatility componentThe risk of price moving between quote issuance and executionWidens during periods of elevated short-term price movement
Liquidity componentThe cost of sourcing or replacing currency externallyHigher for thinner emerging-market currencies
Inventory componentCurrent pool balance versus targetTightens for flows that reduce imbalance; widens for flows that worsen it
In calm markets with balanced pools, spreads sit in the single-digit basis points range for major corridors. The spread widens automatically when conditions deteriorate — this is by design, not a failure state. Tight spreads in calm conditions and wider spreads in stress conditions are both the correct outcome.

Key advantages

  • No slippage — Your execution quality is the same at $1K and $1M. Oracle-based pricing means size does not move the market against you.
  • Real market rates — Every quote is anchored to live institutional FX data, not a synthetic curve that can drift from the real world.
  • Transparent pricing — All spread components are visible in every quote response. You always know exactly what you are paying.
  • Institutional quality — Spreads in the single-digit basis points range for major corridors in normal conditions.