Trade set
Table of Contents
1. Summary
A trade set is a set of trades. Something always defines it, and this page calls that something the set's context. The context is a book, a counterparty, a portfolio, a netting set, a structure, a strategy, a recorded selection, or an operation. The context's entity is the set's identity, and one trade belongs to many sets at once.
2. Detail
2.1. The primitive
A trade set asks nothing of its members beyond membership in it. Every other construct in this cluster is a trade set with something added: a purpose, an operation, or a product.
The set is not the trades. It is the reading of which trades are in it, and a reading needs a standpoint. That standpoint is the context.
2.2. The contexts
| Context | The set | How a trade is in it | Detail |
|---|---|---|---|
| Book | The trades booked into it | One book per trade | Book |
| Counterparty | The trades facing it | One counterparty per trade | Trade Classification |
| Portfolio | The trades in the books below it | Through the book | Books and portfolios |
| Netting set | The trades in the agreement | One netting set per trade | Netting sets |
| Structure | Its legs | Recorded, with a role | Trade Structures and Deal Composition |
| Strategy | The legs of one product family | Recorded, with a role | Trade Structures and Deal Composition |
| A recorded selection | The trades someone chose | Recorded | this page |
| An operation | The trades a run of a process touched | Recorded, with a role | Trade group |
2.3. The context's entity is the set's identity
Where the business names a collection, an entity carries the name. The book is the identity of its trade set, and the netting set is the identity of its own. The set needs no key of its own, because the context supplies one.
An empty set is therefore meaningful. A book with no trades is a book, and a netting set with no trades still has an agreement behind it. A collection with no identity could not be empty, because nothing would record that it exists.
2.4. Membership
A context resolves membership in one of two ways: by derivation from the trades' own attributes, or from a list recorded when the set is created. The choice decides where membership is stored and whether the set changes underneath its reader. Trade set membership states it.
2.5. Nesting
Some sets contain others. The portfolio tree and the structure tree are of this kind, and there membership is part of the trade's identity. Nested trade sets states the test that separates them from the rest.
2.6. What is not a set
A position aggregates trades and has no identity. The system computes it from the trades in scope rather than recording it, so nothing refers to it by key and it is not a set.
Dynamic books, trade blotters and live filters are queries. A query becomes a set when someone records the membership it returned. Until then it is a question asked again each time it is read.
2.7. What follows for the model
- A derived set is a key on the trade's booking and needs no table.
- A recorded set is a table with a key, and a membership table beside it.
- The context's entity supplies the set's key wherever one exists.
- A set whose context has no entity carries a key of its own.
3. Sources
The set, group and structure vocabulary comes from internal analysis notes on structures and deal composition. The reading of a context as the definition of a set, and the derived-versus-recorded distinction, are this page's synthesis.
4. See also
- Trade sets and trade groups — the hub that orders this cluster.
- Trade group — the set whose context is an operation.
- Trade set membership — how membership is resolved, and when it holds.
- Nested trade sets — the sets whose membership is part of a trade's identity.
- Trade links — the relations between trades that hold no container, and are therefore not sets.
- Positions — the aggregate that is neither a set nor a link.
- Data-Oriented Design in ORE Studio — identity by key, and why a named collection needs an entity.
- Trade — the structure note this cluster hangs from.