Skip to main content
OpenFX trading is a quote-then-execute model. You request a quote (a rate locked in for 3 seconds by default), then execute a trade against that quote. Execution is atomic: it either succeeds at the quoted rate or it fails. The same flow covers every conversion: fiat to fiat, fiat to stablecoin, stablecoin to stablecoin.
Splitting quote and trade forces deterministic execution: the rate you saw is the rate that executes, or the trade fails; execution never silently re-prices. Your retry strategy follows from this. After QUOTE_EXPIRED or TRADE_EXECUTION_FAILED, request a new quote and retry the trade with a NEW idempotency key; replaying the same key returns the cached failure.

The trading flow

Endpoints

Quote lifecycle

Quotes are short-lived: 3 seconds by default. You can extend via the quoteForSeconds request parameter.
quoteForSeconds accepts a closed set of standard durations: 3, 15, 30, 45, 60 seconds.
The reverse-quote endpoint (POST /v3/fx/trades/{id}/reverse-quote) defaults quoteForSeconds to 15 seconds. It can return TRADE_NOT_FOUND or TRADE_NOT_REVERSIBLE; POST /v3/fx/trades/{id}/reverse can also return QUOTE_NOT_FOUND, QUOTE_EXPIRED, QUOTE_ALREADY_CONSUMED, and TRADE_INSUFFICIENT_BALANCE. The quote is binding only if you execute POST /v3/fx/trades before expiresAt. Once expired, executing returns 409 QUOTE_EXPIRED; request a new quote and execute against the new id.

Retrieving a quote

You can fetch a previously-created quote by ID for 2 days from its createdAt. The endpoint reads from durable storage, not the create-call’s idempotency cache, so the quote stays retrievable long after the 30-minute idempotency TTL has expired. After 2 days, GET /v3/fx/quotes/{id} returns 404 QUOTE_NOT_FOUND, the same as an unknown ID.

Quote status

GET /v3/fx/quotes/{id} includes a status field not present on the POST /v3/fx/quotes create response:

After execution

The execute response returns the Trade. IMMEDIATE and T0 trades are already EXECUTED; a T1 or T2 trade waits for its settlement window. The statuses, the settle and reverse actions, and the webhooks for each are on Trades.

Common mistakes

  • Expired quote (QUOTE_EXPIRED). Quotes default to 3 seconds. Recover by re-quoting and retrying with a NEW idempotency key.
  • Execution failed mid-flight (TRADE_EXECUTION_FAILED). Call GET /v3/fx/trades/{id} first to check state before retrying.
  • Idempotency key replay (IDEMPOTENCY_MISMATCH). Reusing a key with a different request body returns 422 IDEMPOTENCY_MISMATCH.

What’s next

Trades

Trade statuses, settlement windows, and the settle and reverse actions.

Settlement models

Netted vs Per-Trade settlement models, plus deposits and withdrawals.

Trade webhooks

Push notifications for ready-to-settle, settled, and reversed trades.

Quickstart

Worked end-to-end: quote → trade → balance.

Idempotency

Why both /quotes and /trades require keys.