ores.trading

Table of Contents

1. Diagram

ores.trading component diagram

Figure 1: ores.trading

2. Summary

ores.trading holds the trade and instrument model: the trade envelope and its lifecycle, the instrument identity, and one table per product family across rates, FX, equity, credit, commodity, scripted and bond products. The component is a composite of three parts. The api part is the shared contract, core holds the repositories, readers and services, and service wires the NATS handlers into a runnable binary. The entity models under modeling/ are the literate source every one of those is generated from, together with the SQL schema, the shell command units and their recipes.

3. Sub-components

Sub-component Brief
ores.trading.api Protocol types, domain entities, JSON/table I/O, and NATS message schemas for the tradi…
ores.trading.core Trade booking and lifecycle management — domain model, repositories, services, and NATS…
ores.trading.service NATS service entrypoint for the trading domain — wires handlers, repositories, and conf…

4. Entity modules

Module Brief
ores.trading Logical entities for the trading namespace.

5. Inputs

  • The entity and operation models under modeling/, which are the source the domain types, repositories, services, messages and SQL are generated from.
  • Reference data from ores.refdata: currencies, calendars, day count fractions, business day conventions and the other conventions a trade names.
  • Change reasons from ores.dq, which every bitemporal write states.
  • Parties and tenants from ores.iam, which scope every row.

6. Outputs

  • libores.trading.api.so — the domain, JSON and table I/O, and the NATS protocol headers.
  • libores.trading.core.so — the repositories, the instruments and trade readers, and the services.
  • ores.trading.service — the process that serves the trading subjects.
  • The generated SQL schema and the shell command units, which land in projects/ores.sql/ and projects/ores.shell/trading/.

7. Entry points

  • ores.trading.service — the NATS service binary.
  • include/ores.trading.api/ — every public header a consumer includes.
  • The shell menu trading, whose verbs come from the component's opted-in entity models.

8. Dependencies

  • ores.trading.api — the contract the other two parts and every consumer build against.
  • ores.database — the tenant-scoped connection and the bitemporal helpers.
  • ores.eventing and ores.nats — the transport and the entity change events.
  • ores.refdata, ores.dq and ores.iam — the read-only data above.
  • ores.ore consumes ores.trading.api to write ORE documents as trades.

9. See also

Emacs 29.3 (Org mode 9.6.15)