The trade view
Table of Contents
| Item | Where |
|---|---|
| Prototype | the prototype |
| Gemini review | none |
| Signed off | the owner, 2026-10-29 |
| Group | Trades prototypes |
1. Summary
The trade list and the trade page are the entity screens of a trade. The prototype argues that they serve the journeys Review a trade, Amend a trade's economics and Record a lifecycle event, and that Book a trade is the Add of the list, while the Workflows menu is the door to Import from ORE, Export to ORE and Group into a structure.
The prototype is throwaway. Everything on it is mock data: 38 trades, 7 of them written by hand. The trade types are the 121 of the trade type catalogue.
2. Detail
2.1. States
| Query | What it shows |
|---|---|
?party, ?portfolio or ?book |
The list narrowed to the chosen party, portfolio, or book, with everything under the chosen row. The tree marks the choice, and choosing it again clears the filter |
?state=stale |
The list or page after a change reached the browser: Refresh is gold and a row pulses |
?state=loading, empty, error |
The in-place states of the list, and of the page. empty says there are no trades and points to Book a trade |
?state=refused&tab=history |
The History tab states that the reader may not read it. The other tabs carry on |
?server=today |
The list as the server serves it today: filtered by trade id only. The portfolio tree is not drawn, because the hierarchy it needs is served by no read yet |
?trade=ACME-100201&tab=details |
The trade page. Tabs: details, instrument, identifiers, links, history. A tab switches in place, so a save is not lost |
?trade=ACME-100201&workflow=lifecycle |
Record a lifecycle event, a workflow on a page of its own with the trail Home, Trades, the workflow |
?digest=fixed |
The two digest gaps closed: exercise prices and composite legs move the external version |
?state=conflict |
An Edit dialog that learns another person saved first |
?as=trader, operations, reader |
Who is signed in. A control the person may not use is not drawn |
2.2. The portfolio tree
A trade is filed in one book, and a book hangs from exactly one portfolio. The tree on the left therefore holds both, and the tree and the list are one request.
- A party nests under its parent party, so a holding company shows the operating companies beneath it. A party holds its own root portfolios; a portfolio nests under a portfolio; a book hangs from its portfolio. Each row is followed by its children portfolios and then by its books, and a party's portfolios come before the parties it holds, as the legacy tree drew them.
- A party that holds nothing is drawn as a shell with a count of 0, rather than left out, because a holding company is a real row of the tree.
- The three rows are told apart by their icon, never by their words. A party takes the hierarchy glyph, a portfolio the briefcase and a book the book, which are the icons the icon guidelines name for the concepts:
ic_fluent_organization_20_regular,ic_fluent_briefcase_20_regularandic_fluent_book_20_regular. No new icon is drawn for this screen. - Choosing a party keeps the trades of every book of the parties under it, choosing a portfolio the books under it, and choosing a book that book's trades. The choice marks the row and moves the accent onto its icon.
- Each row states how many trades sit in its subtree, so a person sees where the population is before opening a folder.
- A sandbox's portfolios are virtual and are drawn in italics. The trades in a sandbox leave the list as soon as a portfolio or a book outside the sandbox is chosen.
- The tree keeps its shape while the list shows loading, empty or error, so a portfolio that holds nothing is not a trap.
- The address carries the choice as
?party,?portfolioor?book. A party is a filter of its own,party_id, and the other two are a book filter, because a book of the tree is a book of the trade and a portfolio is the books under it. One book is an equals member,book_id, and many are a one-of member,book_id_one_of. The book combo box of the filter row and the tree stay in step, and choosing one clears the other.
The trade summary read model already carries book_id, so the tree needs no column it lacks. It does not honour the other portfolios a trade may be reported in, which ores_trading_trade_portfolios_tbl records beside the book. A list that must show those is a later decision, and it is recorded in the task.
2.3. What a row is
The list mixes three things, and each states what it is beside its type:
- A trade. One instrument. It states no marker.
- A composite trade. Its instrument is a composition:
ores_trading.composite_instrumentcarries the product andores_trading.composite_legholds the constituent trades. The row statescomposite · 2 constituent trades. - A structure or a package. A deal assembled from several trades:
ores_trading.structurecarries the deal andores_trading.structure_memberholds the trades with the role each plays. The row statesstructureorpackage, and its parent deal when it is nested. - A trade that a deal holds states
leg of STR-0007beside its type, so a leg is never mistaken for a trade standing on its own.
A composite instrument is not a structure. A structure is a deal of several trades and belongs to no instrument. A composite instrument belongs to one trade and holds constituent trades inside it. The two compose at different levels, and a trade may be both: its instrument is composite, and the trade is also a leg of a structure.
The first column states an identifier, never the internal uuid. A trade's uuids are internal, so the column shows one of the trade's identifiers, which ores_trading.trade_identifier records with a type: Internal, UTI, USI or ORE. The read model holds no identifier of its own, so the page reads them for the rows it shows.
2.4. Journeys served
| Journey | Where |
|---|---|
| Review a trade and its history | The list, the page and its History tab |
| Amend a trade's economics | Edit on the Instrument card. Choose the kind of change, edit the fields it allows, read what the change will do |
| Record a lifecycle event | Workflows, Record a lifecycle event, as operations. Four steps: event, facts, effect, record |
| Book | The Book a trade button of the list, and Book a similar trade on the page |
| Import, export, group | The Workflows menu of the list |
2.5. What the Edit dialog argues
The save sends a standard put with the version the edit started from as its precondition, and the reason and the commentary as its change intent. The dialog shows it. The kind of change comes first, as Trade Versioning says. The dialog offers only the activity types the card allows. An economic amendment unlocks the economic fields, a change of reference details unlocks the rest, and a null amend locks all of them and is saved only when nothing changed. Under the fields the dialog says what the save will do: which version moves, and whether a confirmation is issued.
Open the exercise prices card of ACME-100202 and change the strike. The dialog says the external version stays, because the digest does not read that table. This is the defect filed as a capture. Add ?digest=fixed to see it closed.
2.6. What the list does not show
- A notional. An earlier revision of this prototype drew one Notional column. That column was wrong and is gone. A trade has no notional: notional is a property of the instrument, and not every instrument has one. ores.trading.bond_instrument, ores.trading.fra_instrument and the equity option instruments carry one; ores.trading.vanilla_swap_instrument carries none, because each leg states its own, and a leg's notional may step or amortise. A single number for a row cannot be read faithfully, so the list states the trade type and leaves the size to the Instrument tab of the page.
2.7. What is fake
- The data. The prices, the counterparties and the books are mock, and so are the parties, the portfolios and the three joins the tree rests on: the party each root portfolio sits in, the portfolio each book sits in, and the constituent trades of the one composite trade. The root portfolio of a party carries the party's own name, as the seeder lays it out, so two rows of the tree read "Acme London".
- The server. A save waits in the browser until Refresh. State does not survive a reload, except trades booked or imported in the other prototypes. A saved table of rows comes back as text, without its links.
- The activity type codes, except the ones the model documents (new booking, draft capture, amendment, novation, termination, cancellation).
2.8. Where the code lives
doc/prototypes/trades/trade-page/. prototype.js is this prototype. common.js and prototype.css are the same in all four prototypes of the group.
3. See also
- Trade journeys
- Entity screen specification
- Trade Versioning and Trade Lifecycle — the rules the dialog and the workflow follow.