What is the FX Engine?
The FX Engine is Layer 1 of the OpenFX four-layer architecture. It sits between the Identity layer (Layer 0) below and the Banking layer (Layer 2) above, powering every operation that involves converting one currency or asset into another. The FX Engine serves two primary use cases:- Standalone conversions — A customer converts USD to EUR on their own account. The account is debited in USD and credited in EUR.
- Cross-currency payments — A customer sends a payment where the source currency differs from the destination. The FX Engine converts inline as part of payment execution.
From the customer’s perspective, an FX conversion is simply “I converted USD to EUR.”
The internal liquidity mechanism that makes this possible is never exposed in the API.
There are no references to internal counterparties, liquidity pools, or trading books.
Three FX capabilities
The FX Engine provides three categories of functionality, each building on the last:| Capability | Endpoint | Purpose |
|---|---|---|
| Discovery | GET /fx/asset-pairs | Find out which asset pairs are available and their min/max amounts |
| Pricing | GET /fx/rates/indicative and POST /fx/quotes | Get informational rates or lock an executable rate for 60 seconds |
| Execution | POST /fx/conversions | Execute a conversion that debits one currency and credits another |
- Discover pairs — Call
GET /fx/asset-pairsto confirm the pair is available and check min/max amounts. - Get a rate or lock a quote — Use
GET /fx/rates/indicativefor informational display, orPOST /fx/quotesto lock a rate for execution. - Execute — Call
POST /fx/conversionswith either a locked quote ID or at-market parameters.
Sell/buy naming convention
All FX fields use sell/buy terminology, not source/target. This is a locked design decision that matches industry conventions from CurrencyCloud, Airwallex, and other leading FX platforms.| Field | Description | Example |
|---|---|---|
sellCurrency | The currency being sold (debited) | "USD" |
buyCurrency | The currency being bought (credited) | "EUR" |
sellAmount | The amount of the sell currency | "10000.00" |
buyAmount | The amount of the buy currency | "9250.00" |
sellAmount or buyAmount
(never both). The system calculates the other side at the current rate. The
FxAmountInputSide field (sell or buy) indicates which side was authoritative.
AssetCode — fiat and crypto unified
TheAssetCode type (pattern ^[A-Z]{2,10}$) is used for sellCurrency and buyCurrency
across all FX endpoints. It accommodates both fiat ISO 4217 codes and crypto asset tickers:
| Type | Examples | Format |
|---|---|---|
| Fiat | USD, EUR, GBP, SGD, MXN, BRL | ISO 4217, 3 uppercase letters |
| Crypto | USDC, USDT, EURC, PYUSD | Ticker, 2-10 uppercase letters |
USD to USDC uses the
same endpoints as a conversion from USD to EUR.
FX on payments
When a payment’s source currency differs from the delivery currency, the FX Engine handles conversion inline as part of payment processing. There are two execution modes:| Mode | executionPreference | How it works |
|---|---|---|
| Pre-locked quote | use_quote | You create an FX quote first (POST /fx/quotes), then reference its quoteId in the payment. The payment executes at the locked rate. |
| At-market | at_market | No quote needed. The payment converts at the current market rate at the time of processing. |
- Payment estimates (
POST /payments/estimates) — Get a non-binding cost preview including FX rate, fees, and delivery timeline. - Payment quotes (
POST /payments/quotes) — Lock an executable payment quote with guaranteed FX rate, fees, and total cost.
FX guides
Asset Pairs
Discover available trading pairs, supported currencies, and min/max amounts.
Quotes & Rates
Get indicative rates for display or lock executable quotes for 60 seconds.
Conversions
Execute currency conversions on customer accounts.
API Reference
- GET /fx/asset-pairs — List available asset pairs
- GET /fx/rates/indicative — Get indicative FX rate
- POST /fx/quotes — Create FX quote
- GET /fx/quotes/ — Get FX quote
- POST /fx/conversions — Create conversion
- GET /fx/conversions — List conversions
- GET /fx/conversions/ — Get conversion