A live and a simulated source differ only inside the adapter

Table of Contents

1. Summary

The system handles real vendor data and synthetic data in the same way. The only differences are inside the adapter, in the rate card of the source, and in the kind label that a person can read. Everything in ores.marketdata, and everything that consumes market data, is identical.

2. Detail

real_and_simulated_adapters.png

Figure 1: A live adapter and the simulator behind the same contract.

Source: real_and_simulated_adapters.puml. Regenerate with plantuml -tpng doc/knowledge/architecture/real_and_simulated_adapters.puml.

2.1. What is the same

Part Live and simulated
Provider and vendor ids The same provider code, id schemes, ids and fields.
Mapping One mapping for the provider. See The mapping belongs to the provider and not to the source.
Adapter contract The same four messages. See An adapter and the service meet at four messages.
Ingest, quality, storage The same path. See The ingest loop and the one pipeline and Quality checks run between mapping and storage and ignore the source kind.
Quote series key (item, provider, party). See A quote series is keyed by item, provider and party.
Subscription and routing The same entities and the same screens. See A party routes to exactly one source for each provider.
Entitlement and metering The same events. See Usage is recorded as events and priced later.
Party stream The same subject and the same tick. See The market tick.

2.2. What differs

Part Live adapter Simulator
Where values come from A vendor session A generator run in the adapter
Credentials Vendor credentials held by the adapter None
Universe What the vendor entitles The universe the generators cover
Time The vendor's clock The simulator's clock, written as vendor time
Faults Arrive from the network and the vendor Injected on purpose, or absent
Authoring None. The vendor defines the data. Collections, folders, generators and preview
Source kind live simulated
Rate card The real contract A simulated rate card
The bill The system pays the vendor A shadow bill, with no payment
Component One service for each provider ores.marketdata.synthetic

2.3. Two sources of one provider can run together

bloomberg-live and bloomberg-sim are two sources of the provider Bloomberg. Each has its own adapter. A development party routes to the simulated source, and a prelive party routes to the live source, at the same time. Both read the same ids and the same mapping. See A party routes to exactly one source for each provider.

2.4. How a person finds out

A party can read the kind of any source it is routed to, on the source's screen and on the series. The service hides nothing. The system simply never needs the answer to behave correctly. See No code path may behave differently because a source is simulated.

2.5. Who defines what

See A system bundle installs the catalogue and the simulator installs its own universe for where each definition lives and who installs it.

3. See also

Emacs 29.3 (Org mode 9.6.15)