The simulator stops at the adapter seam
Table of Contents
1. Summary
The simulator imitates what a vendor delivers. It does not imitate how the
vendor delivers it. It reproduces vendor ids, field names, vendor time and
realistic failure behaviour. It does not reproduce the blpapi session, the
Elektron wire formats or vendor authentication.
2. Detail
2.1. Three levels of fidelity
| Level | Covers | Decision |
|---|---|---|
| Data | Ids, fields, vendor time, tick rates, market hours, stale values, gaps, bad ticks | Build |
| Adapter contract | Announce, demand, tick, heartbeat | Build |
| Vendor protocol | Sessions, wire formats, authentication | Do not build |
2.2. Why the seam is the limit
- A live adapter turns a vendor protocol into the adapter contract. Everything behind the seam is the service's own. A protocol simulator would test only the translation code of a live adapter.
- Vendor protocols are large and they change. A copy would be a project of its own.
- The rule in No code path may behave differently because a source is simulated holds at the seam.
2.3. Fault injection
The simulator can fail the way a vendor fails. A generator can drop a
connection, delay ticks, repeat ticks, send a value outside the range, or reject
an id with not_entitled. These faults go through the adapter contract, so the
checks in Quality checks run between mapping and storage and ignore the source kind and the state changes in The adapter lifecycle are tested
against them.
2.4. Replay
A replay adapter reads recorded vendor ticks and publishes them. It is another
adapter of kind replay. It is the way to test the protocol code of a future
live adapter, and it needs no change in the service.
3. See also
- Market Data Architecture — the structure note that orders this cluster.
- An adapter and the service meet at four messages — completes: the seam where the simulator stops.
- The simulator is one adapter plus the tools that author its generators — completes: what the simulator builds up to that limit.
- A live and a simulated source differ only inside the adapter — completes: the differences that remain.