FX Conversion & Hedging
Integration pattern for converting balances using spot FX trades for routine conversion and OTC deals for larger negotiated transactions.
FX Conversion & Hedging
Use this pattern when your integration needs to convert balances between currencies using either spot FX trades for routine conversion or OTC deals for larger negotiated transactions.
✅ Before you start
Complete these steps before you implement the FX pattern:
- Authenticate with the merged Login service and store the returned
tokenandcompanyId. - Confirm both the source and target wallets exist.
- Confirm the source wallet has enough
availableBalancefor the planned conversion. - Decide whether the conversion size warrants a spot trade or an OTC deal.
- Register webhook endpoints so you can reconcile FX trade completions.
📚 Use this page with the recipe
This guide explains when to use the FX conversion pattern and the minimum sequence. For the implementation walkthrough, use the recipe:
FX Conversion & Hedging Recipe →
The FX pattern
This integration pattern follows a simple sequence:
- Get a live FX rate with Get FX rate when a quote is needed.
- Execute the conversion before the
vfx_tokenexpires by calling Create FX trade. - Store the FX trade
paymentIdandreferencefor reconciliation. - Use OTC deals for larger sizes that need a negotiated rate, then retrieve and reconcile them through the OTC Deals API.
- Track final state through webhooks before treating the converted balance as available.
What makes this pattern different?
Unlike a single transaction flow, FX conversion as an integration pattern needs to:
- respect short
vfx_tokenlifetimes for spot rates - fall back to OTC deals when size or pricing demands it
- reconcile both
inwardSettlementTimeandoutwardSettlementTimeper trade - support FX markup configuration where the platform sets customer-facing pricing
Where to go deeper
Troubleshooting
| Issue | What to check |
|---|---|
vfx_token expired | Request a fresh rate and execute the trade within the supported window. |
| Trade stuck in an intermediate state | Check webhook deliveries and confirm whether settlement or compliance review is delaying completion. |
| Quoted rate differs from executed rate | Confirm whether platform FX markup is applied and matches your customer-facing quote. |
| OTC deal not visible | Filter by status, currency, and date with the OTC Deals API. |
Next steps
| FX Conversion Guide → Run a complete FX trade from rate to settlement. | OTC Deals → Track larger negotiated trades through the OTC Deals API. |
Updated 3 days ago
