Trace a process run over a set of trades
Table of Contents
This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
1. What
A process that acts on a set of trades — a compression, a merge, an allocation, a funding roll, a sweep run, a cleardown, an import, a bulk book move — must be traceable so it can be undone or repeated. Three pieces are missing:
- An enumeration of the processes, so a run names which process ran.
- A table recording each run of a process, with an id generated for that run. The run is expected to need a state machine over its evolution, in the way the other long-running records in the tree do.
- The run id as the foreign key the trade groups carry, for the inputs and for the outputs, so the set of trades a run read and the set it wrote are both reachable from the run.
This is roughly the shape and not yet a design. It needs proper analysis before it is built.
2. Why
A process that read a hundred trades and changed none of them leaves no trace today, and a process that read a hundred and changed two cannot be told from one that read two. Undo and repeat both need to know what the inputs were and at which time point the process read them, because a repeat has to reconstruct the same input set rather than today's.
Trade sets and trade groups states what a trade group is: a trade set created for a run of a process, with the run supplying the identity, the provenance, the roles and the undo. What is missing is the run itself.
3. Approach
Pilot one process end to end before adding the rest, and pick it from the processes already in the tree rather than inventing one:
- Funding roll (Tom/Next) and sweep run (Spot Sweep) are candidates, because both have a book in the tree that describes them and both run over a population rather than over a pair.
- Add the remaining processes only once the pilot has settled the run table, the state machine and the input/output keys.
4. The stamp is not the run
A trade amendment carries a trade activity stamp that classifies what the amendment was about, so risk buckets by amendment type. It stands alone and needs no other trade. Where an amendment was generated by a process, the process stamps its own activity, so the stamp matches the run in some cases — and that match is incidental. Nothing requires a stamp to point at a run, and a stamp exists for many amendments no process produced.
For that reason the stamp stays as it is, and this work adds the run beside it rather than behind it.
5. References
- Trade sets and trade groups — the trade group, and the test a set must pass.
- Trade group — the set a run creates, and the roles its process fixes.
- Trade Structures and Deal Composition — the trade set that is also a product, and why it is not a run.
- Trade link types — the catalogue of relations between trades, including the groups.
- Trade compression, Trade merge and Trade allocation — the trade groups with the most structure.
- Tom/Next and Spot Sweep — the two candidate pilots.
6. See also
- Implement the processes that act on sets of trades — the processes this run record exists to make traceable.
- Trace a process run and the trade groups it creates — the story that records what this capture describes.