The FX spot generation config

Table of Contents

1. Summary

An fx_spot_generation_config describes how to synthesise the tick stream for one FX spot rate. It is declared in ores.synthetic.api/domain/fx_spot_generation_config.hpp, it hangs under a market_data_generation_config through config_id, and its mixture components are separate gmm_component rows.

2. Detail

2.1. What the row names

  • The pair, as base_currency_code and quote_currency_code. Both are soft foreign keys to currencies.
  • The datum, as oresmd_uri, the quote URI of the spot rate that the vendor instrument maps to, for example "oresmd://fx/EUR?type=quote&instrument=fx_spot&quote=rate&ccy=USD". It is derived from the pair rather than typed. The feed reads it with the strict codec at construction, and refuses a URI that is not an fx_spot quote or whose pair differs from the two currencies. See oresmd: ORE Studio Market Data URI and The oresmd datum identity.
  • The vendor instrument, as provider_code, id_scheme, external_id and field, for example bloomberg, bbg_ticker, EURUSD Curncy and PX_LAST. It is the id the simulator publishes under, and it is unique among generators. The generator carries no source name and no mark of the simulator.
  • The cadence, as ticks_per_hour.

2.2. Where the initial price comes from

price_source holds "fixing" or "fixed", and a SQL check restricts the column to those two. A new config starts on "fixing".

  • Under "fixing" the feed starts from the newest public fixing of its pair, read at feed start, and its mixture is sized to the spread of the fixings over a window. The candidates come from the class's calibration policy and the series that cover the pair, unless the config names its own items in fx_spot_fixing_item or overrides the window in calibration_window_days. See Publish public fixings through an adapter.
  • Under "fixed" the process starts from gmm_initial_price as entered. This is the stated fallback for a pair no public source fixes. A "fixing" config that finds no fixing also keeps gmm_initial_price, unless the policy refuses to start it.

gmm_initial_price is greater than zero under either value, since it is the fallback level. No feed reads a dated reference observation as its start.

ticks_per_hour has its own check and must be greater than zero. It sets the publish cadence only. The mixture moments are already per tick, so the process step does not change with the cadence.

2.3. The process choice

process_type holds "geometric", "arithmetic" or "ornstein_uhlenbeck", and a SQL check restricts the column to those three strings. The default is "geometric".

The column is a plain string and not a foreign key. An unrecognised value is therefore not rejected at write time. It is forwarded to process_factory::make_process, which falls back to the geometric engine for any string it does not recognise. See The generator library.

The mixture itself is not on this row. The means, standard deviations and weights live as gmm_component children. See The GMM component.

2.4. enabled and auto_start

The two flags are orthogonal and they answer different questions.

  • enabled says the config is startable at all. A disabled config may not be started by an auto-start pass or by a manual Start action.
  • auto_start says the config starts on its own when the service comes up, in every active tenant. A generator reads its fixings as the system service and needs no grant. A config can be enabled and not auto-start, which is the shape a legacy or alternate-index variant takes when it lives beside a currency's primary config.

Starting a generator is refused outright when another generator already serves the same vendor instrument. Nothing auto-disables the running one, so a switch is a Stop followed by a Start.

2.5. The fact the code shape does not show

folder_id is optional, and only the bundle path fills it. A rate made by hand has no position in the Market Simulator tree.

The pair is not the process identity. Two configs for the same pair differ by their component rows, and the collision rule binds them by the vendor instrument alone, so they cannot run at the same time whatever else differs.

3. See also

Emacs 29.3 (Org mode 9.6.15)