← Lessons

quiz vs the machine

Platinum1780

System Design

The Foreign Exchange Handling

Locking rates, recording spreads, and accounting for conversion gains and losses.

6 min read · advanced · beat Platinum to climb

The rate problem

Exchange rates move continuously. A conversion quoted at one instant may settle at another, so a foreign exchange system must lock a rate, record it, and account for any difference between quote and settlement.

Quote and lock

The system fetches a quote with a short validity window and a lock the user accepts. The locked rate is stored with the transaction so the settled amount is deterministic and auditable.

Spread and revenue

The customer rate usually differs from the market mid rate by a spread. The spread is the provider revenue and must be posted to a dedicated account so margins are visible and reconcilable.

Gains and losses

When a position settles at a different rate than booked, the difference is a realized gain or loss. The ledger posts this to an FX gain loss account so the books still balance.

Operational guidance

  • Enforce rate expiry so stale quotes cannot be executed.
  • Post spread to a revenue account separate from the principal legs.
  • Recognize gain or loss explicitly so balances reconcile.

Key idea

Foreign exchange locks and records a rate, posts the spread as revenue, and books gains or losses so the ledger balances.

Check yourself

Answer to earn rating on the learn ladder.

1. Why lock and store the exchange rate with the transaction?

2. Where should the FX spread be posted?

3. What is a realized FX gain or loss?