Story: Rework the equity instruments to the instrument table rule

Table of Contents

This page documents a story in Sprint 28. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

1. Goal

Rework options, forwards, swaps, variance swaps, barriers, digitals, Asians, accumulators and positions, closing defect 9 to the instrument table rule of the trade shape investigation (section 14), as the bonds were reworked, with the data-oriented review deciding the tables.

2. Status

Field Value
State DONE
Parent sprint Sprint 28
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-24

3. Acceptance

  • The family header's trade_type check lists exactly the family's codes, and each product fact table checks its own.
  • Every instrument row is keyed by its trade and pinned to the anchor's trade type and party by a composite foreign key.
  • The family's trade types route to their tables through the trade-type catalogue, not hand-written code.
  • The ORE round trip stays lossless across the family's corpus.

4. Tasks

Task State Start End Description
Analyse the equity family against data-oriented design DONE 2026-10-16 2026-10-16 Walk the equity family's models, SQL, tests and round trip against the data-oriented design criteria and the instrument table rule, and propose the target model.
Record the variant retirement in the equity staging DONE 2026-10-17 2026-10-17 The equity analysis names the nested std::variant as finding E5 and retires it in the mapping, but no staged unit carries it or checks for its absence. Add the unit so the Regime 3 finding has an owner and a gate.
Repair the equity routing DONE 2026-10-17 2026-10-17 The catalogue routes an equity code to a table other than the one the importer writes, so the stored trade_type_code and the routing disagree. Point the 17 routed codes at the equity table, take the position sub-trade off the composite anchor, and leave the 13 unrouted codes empty.
Write the equity basket as rows DONE   2026-10-17 The worst-of basket swap holds its constituents as a JSON string in basket_json. A list is rows of a child table, so author equity_basket_constituents keyed by the trade and the constituent's ordinal, and retire the JSON column from the model.
Author the equity family header DONE 2026-10-17 2026-10-17 The equity family has no header, so it has no common dates and the 17 routed codes point at nine product tables. Author equity_instrument, keyed by the trade, holding only the columns every code shares. The routing and the fact-table columns that move follow with the mappers.
Test the equity position underlying DONE 2026-10-17 2026-10-17 E15: equity_position_option_underlying has a table, a history field mapper and an event registrar, but no eventing or repository test. Enable the generated eventing test and check what it covers.
Record the equity arc status DONE 2026-10-17 2026-10-17 Units 1 to 5 and E15 are merged. Record the state, the PRs, and the evidence that units 6 to 11 are mapper work that cannot be done as model work, so the next phase starts from the finding rather than rediscovering it.
Author the cliquet fact table DONE   2026-10-18 The design gives EquityCliquetOption its own fact table, and today the code routes to equity_option_instrument, whose columns cannot hold a cliquet's moneyness, caps, floors or premium. Author equity_cliquet_option_instrument from the ORE cliquet binding.
Author the outperformance fact table DONE   2026-10-18 EquityOutperformanceOption routes to equity_option_instrument, which cannot hold two underlyings, two initial prices, a strike return and two knock prices. Author equity_outperformance_option_instrument from the ORE binding.
Author the TaRF fact table DONE   2026-10-18 EquityTaRF routes to equity_accumulator_instrument, whose shape has no target amount, target points or strike. Author equity_tarf_instrument from the ORE binding; the schedules and the barrier stay with the shared children.
Close the equity model phase DONE   2026-10-18 Every additively-modelled equity product has its own table. Record that the three remaining splits and the routing re-point are mapper-coupled, with the line numbers that prove it, so the next phase starts from the finding.

5. Decisions

6. Out of scope

Emacs 29.3 (Org mode 9.6.15)