Task: Analyse the credit family and propose its relational data model
Table of Contents
This page documents a task in the Rework the credit instruments to the instrument table rule story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Survey every credit surface and propose the relational entity-relationship model that reworks the family to the instrument table rule of the trade shape investigation section 14, following the bond pilot and the rates rework.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Rework the credit instruments to the instrument table rule |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-11 |
3. Acceptance
- Every credit-related type and subtype is inventoried across the modeling orgs, SQL, domain C++, mappers, repositories, services, messaging and the ores.ore mapping.
- The current model's divergences from the instrument table rule are recorded as findings, each with its evidence, including the risk participation agreement's required elements, which the export omits.
- The proposed entity-relationship model is recorded as a diagram and table set: family header, product facts, shared children and securities.
- The ORE binding's bare float members that the credit corpus uses are listed, so the digits work is planned.
- The rework is staged into verifiable units; no code changes land on this task.
4. Plan
- Survey. Read the credit model, the generated surface, the ORE mapper, the binding's credit structs, the catalogue and the corpus documents.
- Findings. Record each divergence from the instrument table rule with its evidence.
- The model. Propose the header, the product facts and the shared children in a table set and a diagram.
- Staging. Order the rework into units that each end in a check.
5. Measurements
Every number this task claims about a tree, with the command that produced it
and the commit it was measured at. A number without both is not a measurement,
because a clean-up record describes a tree and trunk moves under a branch: a
consumer count, a gate's component count and a suite's size all change with no
code changing, and the reader of a bare number cannot tell which tree it came
from. Where the raw output matters, put it in an evidence/ file beside the
task and name that file in the Command column.
| What | Value | Command | Commit | ||
|---|---|---|---|---|---|
| Credit trade types in the catalogue | 8 | =grep -c " | credit * | " projects/ores.trading/modeling/ores.trading.trade_type_catalogue.org= | 0956bd1dd2 |
| Columns of the credit table | 25 | read projects/ores.trading/modeling/ores.trading.credit_instrument.org |
0956bd1dd2 | ||
| Columns no mapper writes | 6 | grep -c "instr.tenor" projects/ores.ore/core/src/domain/credit_instrument_mapper.cpp and the five like it, all 0 |
0956bd1dd2 | ||
| Credit documents in Example_Trades | 8 documents, 8 trades | =grep -lE "<TradeType>(CreditDefaultSwap\ | …\ | RiskParticipationAgreement)</TradeType>" external/ore/examples/Products/Example_Trades/*.xml= and grep -h with wc -l |
0956bd1dd2 |
| Credit documents in all example directories | 32 | the same grep -rlE over external/ore/examples |
0956bd1dd2 | ||
| Tracked files named for credit_instrument | 50 | git ls-files with grep -ic credit_instrument |
0956bd1dd2 | ||
| Tracked files named for rpa_instrument | 47 | git ls-files with grep -ic rpa_instrument |
0956bd1dd2 | ||
| Credit test cases | 33 | grep -c TEST_CASE over the mapper, golden, eventing and shell command tests |
0956bd1dd2 | ||
| Mapper length | 391 lines | wc -l projects/ores.ore/core/src/domain/credit_instrument_mapper.cpp |
0956bd1dd2 |
6. Notes
- The design is
design.orgbeside this page, withdesign_er.pumland the rendereddesign_er.png. - The operator asked that the key principles of the work be remembered and
that a checklist be written from the bond and rates work. Three memories
record the principles (data-oriented design, the hot and cold split, exact
decimals), and the runbook
rework_an_instrument_familyholds the checklist. - The rates repair already routed
RiskParticipationAgreementto the credit table. What is left of the agreement's problem is its required elements, its underlying and the retiredrpa_instrumentstable.
7. Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario)
that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.
| Scenario | State | Notes |
|---|---|---|
8. PRs
| PR | Title |
|---|---|
| #3133 | [agile] Analyse the credit family |
9. Review
| # | Comment summary | File | Decision | Notes |
|---|---|---|---|---|
| 1 | The summary counts four single-product columns and names none | design.org | accept | The four are named. |
| 2 | "Renamed from nothing" is awkward | design.org | accept | Reworded. |
| 3 | An agreement's underlying option and the trade's own option share the option table | design.org | accept | Recorded as an open question; unit 6 settles it. |
| 4 | Check the option reuse against the rates design | design.org | decline | No change needed; StrikeType is on the option fact table. |
| 5 | Status padding and empty scaffold tables | the task page | decline | Cosmetic, written by compass. |
| 6 | Unit 3 is too large | design.org, story.org | accept | The retirement is its own unit, so there are eight units. |
| 7 | Confirm the CI doc-lint result | the PR | decline | CI reports it; the local validation and misspell checks are clean. |
10. Result
The credit family is surveyed and the rework is designed. The family is eight trade type codes in one 25-column table, and six of the eight have an importer. The design finds fourteen divergences from the instrument table rule, among them six columns no mapper writes, two importer-less codes, an exported risk participation agreement that is not valid ORE, and money values stored as float artifacts.
The proposal is a six-code header with the reference entity and the two
dates, six product fact tables keyed by the trade, the swap leg tables reused
with a leg_group column, the shared option and strike children reused, and
one new basket child. The rework is staged into eight units, from the digits
to the proof over the eight corpus documents.
Acceptance met: every credit type is inventoried, the divergences are findings with evidence, the model is a table set and a diagram, the bare float members the credit corpus uses are listed, and the rework is staged with no code change.