Funds move when a trade reaches EXECUTED, not
when you create it. A trade created with a T1 or
T2 window waits, and on a per-trade settlement
account it then waits for you. Read
status before you assume a balance has
changed.Endpoints
State machine
Trade.status is a closed enum, and a trade ends in EXECUTED or REVERSED.
Settlement window
Every trade carries asettlementWindow that you choose on the quote request: IMMEDIATE, T0, T1, or T2. It defaults to T0.
In the live environment, T1 and T2 are currently available only for pairs of EUR or MXN against USD, USDC, or USDT, in either direction. For example, EUR/USD, USDC/EUR, MXN/USDT, and USD/MXN. The sandbox accepts all pairs. If you need T1 or T2 for another pair, reach out to your Customer Success representative or to support@mail.openfx.com.
- IMMEDIATE trades settle synchronously, so the execute response already reads EXECUTED.
- T0 trades are not future-dated. The window opens at execution. On an AUTO account the execute response already reads EXECUTED. On a MANUAL account it reads READY_TO_SETTLE until you settle or reverse the trade.
- T1 and T2 trades are future-dated. They sit in LOCKED until the window opens: 24 market hours after execution for T1, and 48 for T2.
status and the trade webhooks instead.
What happens at settlement depends on your organization’s settlement model, an account-level setting rather than a request option. The tradeSettlementMode field holds it.
IMMEDIATE trades never reach READY_TO_SETTLE, on either model, because they are already EXECUTED when the execute call returns. You can’t settle or reverse them.
On an AUTO account, an IMMEDIATE or T0 trade settles at execution even when your sell-side balance is short, and the shortfall counts against your exposure limit. On a MANUAL account, execution returns TRADE_INSUFFICIENT_BALANCE unless the sell-side balance covers the trade, in every window.
The models are compared on Settlement models.
Settle a trade
Settling applies only to a trade in READY_TO_SETTLE on a MANUAL account. It completes the trade at the locked rate and populatessettledAt and settlementStartTime.
cURL
TradeSettlement in data. The trade is now EXECUTED:
Reverse a trade
A reversal unwinds a trade in READY_TO_SETTLE instead of settling it. It takes two calls, so you see the cost before you commit.1
Generate a reverse quote
POST /v3/fx/trades/{id}/reverse-quote returns a time-limited quote. quoteForSeconds takes the same closed set of durations as a trade quote: 3, 15, 30, 45, or 60. As with trade quotes, holds longer than 15 seconds are priced higher to account for market volatility.cURL
reversalDetails before you act. direction says whether the reversal would DEBIT or CREDIT your balance, and differentialAmount is the unsigned magnitude in currency.2
Execute the reversal
POST /v3/fx/trades/{id}/reverse names the reverse quote’s id as quoteId. Send it before expiresAt. An optional clientReferenceId labels the reversal.cURL
originalTradeId points at the trade it unwound, and the original trade reads REVERSED.409 TRADE_NOT_REVERSIBLE.
Track a trade
Trade webhooks report each transition, so you don’t need to poll. The three events map one-to-one onto the statuses a trade reaches under your own action or OpenFX’s.
An AUTO account only receives fx.trade.settled. A MANUAL account can receive all three.
The webhook
data is close to the Trade resource but not identical. It adds tradeSettlementMode and settledAt, and on fx.trade.reversed it adds reversalTradeId and reversalDetails. settledAt is null on a reversal, because a reversal only ever unwinds a trade that was never settled. Webhooks setup covers delivery and signature verification.
If you can’t receive webhooks yet, poll GET /v3/fx/trades/{id} and read status.
Effect on balances and exposure
A trade changes your balances when it reaches EXECUTED. ReadGET /v3/fx/balances afterward; the trade response does not carry the balance impact.
Before then, an open trade counts against your exposure limit. A LOCKED trade counts as settlableLater exposure and a READY_TO_SETTLE trade as settlableNow. See Exposure.
Common mistakes
- The account cannot fund or support the trade. For
409TRADE_INSUFFICIENT_BALANCE, useerror.detailsto check the required and available amounts. For409TRADE_CREDIT_LIMIT_EXCEEDED, check the account’s exposure. After you resolve the condition, check the quote’sexpiresAt. If it has passed, request a fresh quote and use its ID. Submit the trade with a new idempotency key. - Expecting EXECUTED from a future-dated trade. A T1 or T2 trade returns before its window opens, so its funds have not moved.
- Calling settle on an automatic account. It returns
409TRADE_NOT_MANUAL. Netted accounts never settle by hand. - Letting a reverse quote lapse. The reversal must reach
POST /v3/fx/trades/{id}/reversebeforeexpiresAt; generate a new reverse quote with a new idempotency key. - Reading the reversal as the original. The reversal is a separate trade with its own
id. Match it to the original throughoriginalTradeId, orreversalTradeIdon the webhook. - Retrying a failed execution blind. After TRADE_EXECUTION_FAILED, call
GET /v3/fx/trades/{id}to check state first.
What’s next
Settlement models
Netted and per-trade settlement, side by side.
Balances
What changes in each currency when a trade executes.
Trade webhooks
Ready-to-settle, settled, and reversed events.
Exposure
Exposure-limit usage from trades that have not settled.