FX System
FX System
The FX subsystem provides repeatable, stable currency conversion for pricing.
It uses:
- A public FX source (e.g.
open.er-api.com) - A configured base currency (often
USD) - Caching (e.g. 24 hours) for stability and lower volatility
Core Flow
- Load or fetch latest FX rates (base → quote).
- Cache them in memory for a period (e.g. 1440 minutes).
- For each request:
- Look up
baseCurrency→destinationCurrencyrate. - Compute
convertedNetPrice = basePrice * fxRate.
- Look up
If no FX rate is available, the API will:
- Return
FX_LOOKUP_FAILED, or - Fall back gracefully (depending on configuration).
Metadata
FX metadata is visible via GET /v1/meta/fx, which includes:
source– provider usedasOf– timestamp of latest FX snapshotcacheTtlMinutes– configured TTL
This lets you expose “Last FX update” to your operations dashboard.