ores.refdata.instrument_code

Table of Contents

General-purpose product catalogue: one row per instrument/product type the system knows about, covering every trade type in ORE's own authoritative oreTradeType enumeration (external/ore/xsd/instruments.xsd), plus one ORE Studio-specific addition, DEPO (ORE has no distinct money-market-deposit trade type — it models a deposit as a single-period Swap — so DEPO is added purely to give the IR Curve Template a distinct short-end label; its pricing still derives from the same par-rate formula a single-period swap would use). The code column is deliberately not ORE's own oreTradeType spelling: traders need something they can actually type quickly, and ORE's names (FxDoubleBarrierOption, EquityStrikeResettableOption) don't serve that. code is instead a short, FIX-inspired mnemonic (FRA, IRS, CDS, FXBAR, EQVS…), unique and typically under 10 characters. The literal ORE oreTradeType string, where one exists, is preserved separately in ore_trade_type (nullable — null only for DEPO) for future ORE trade-file interop; it is not itself validated or FK'd anywhere, only carried as a reference. Each row that describes one instrument is tagged with the asset_class_code it belongs to; rows that do not are left untagged (see asset_class below). Not scoped to any single consumer: the IR Curve Template (which consumes the DEPO=/=FRA=/=IRS rates entries for its tenor roles) is the first consumer, but this catalogue exists independently for any future feature needing to classify or enumerate the instrument types the system supports. Managed by the system tenant, like other shared code tables.

1. Flags

2. Columns

2.1. code

Unique short, FIX-inspired mnemonic code for the instrument type – not ORE's own oreTradeType spelling (see ore_trade_type below for that). Chosen so a trader can type it quickly.

Examples: 'IRS', 'FRA', 'CDS', 'FXBAR', 'EQVS'.

std::string("InstrumentCode")

2.2. name

Human-readable full name for the instrument code (e.g. "Forward Rate Agreement" for FRA).

std::string(faker::word::adjective()) + " Instrument"

2.3. description

Detailed description of the instrument code.

std::string(faker::lorem::sentence())

2.4. asset_class

Asset class this instrument code belongs to, when the product type has a fixed one (references asset_class_code.code; column named asset_class, not asset_class_code, to avoid a C++ name lookup collision between the member and the asset_class_code domain type itself in generated code). Null where a product type has no class of its own. Two groups are null: sentinel and wrapper rows (NONE, FAILED, CASHPOS, COMPOSITE, SCRIPT), which describe something other than one instrument; and generic trade types (ASCOT, TRS, CFD, AUTOCALL, DBLDIG, EUROBAR, PERFOPT), which take the class of whatever underlying they reference. A trade of one of those types carries its class on the trade itself, not on the catalogue row.

std::string("interest_rates")

2.5. ore_trade_type

Literal ORE oreTradeType string (external/ore/xsd/instruments.xsd) this code corresponds to, e.g. 'ForwardRateAgreement' for FRA. Null only for DEPO, the one ORE Studio-specific addition with no ORE trade type of its own. Preserved for future ORE trade-file interop; not itself validated or referenced by any FK.

std::string("ForwardRateAgreement")

2.6. display_order

Order for UI display purposes.

faker::number::integer(1, 100)

2.7. curve_role

Role this instrument plays when deriving a rate from a curve (references curve_role.code): DEPOSIT, FRA, or SWAP for the instrument types the IR Curve Template uses, NONE for every other instrument code (the great majority of the catalogue). Determines which curve_instrument_pricer derivation applies – simple rate, implied forward, or par-rate solve – when this instrument's tenor entry is priced from a short-rate process's discount_factor().

std::string("NONE")

3. SQL

3.1. Flags

3.2. Extra drops

drop function if exists ores_refdata_validate_instrument_code_fn;

4. Validation function

5. Insert trigger

5.1. Validations

column validation_function
asset_class ores_refdata_validate_asset_class_code_fn
curve_role ores_refdata_validate_curve_role_fn
change_reason_code ores_dq_validate_change_reason_fn

6. C++

6.1. Flags

6.2. Repository

6.3. Domain includes

#include <string>

6.4. Entity includes

#include <string>

6.5. Conventions

6.6. Table display

column header
code Code
name Name
description Description
asset_class Asset Class
ore_trade_type ORE Trade Type
curve_role Curve Role
display_order Display Order
modified_by Modified By
version Version

6.7. Presentation

6.7.1. Detail fields

field label widget type is_key is_required placeholder flag_source combo_domain_type combo_fetch_include combo_fetch_fn combo_watcher_name combo_code_field combo_tooltip_field combo_sort_field combo_label combo_setter_pascal badge_key
code Code codeEdit line_edit true true Enter a short code (e.g. FRA)                      
name Name nameEdit line_edit   true Enter full name                      
description Description descriptionEdit text_edit   true Enter a description                      
asset_class Asset Class assetClassCombo dynamic_combo         refdata::domain::asset_class_code   fetch_asset_class_codes assetClassWatcher code description display_order asset class codes AssetClassCombo asset_class
ore_trade_type ORE Trade Type oreTradeTypeEdit line_edit     Enter the literal ORE oreTradeType (if any)                      
curve_role Curve Role curveRoleCombo dynamic_combo   true     refdata::domain::curve_role   fetch_curve_roles curveRoleWatcher code description display_order curve roles CurveRoleCombo curve_role
display_order Display Order displayOrderEdit spin_box   true                        

6.7.2. Columns

enum_name field header type width is_badge badge_key
Code code Code string auto    
Name name Name string auto    
Description description Description string auto    
AssetClass asset_class Asset Class string auto true asset_class
OreTradeType ore_trade_type ORE Trade Type string auto    
CurveRole curve_role Curve Role string auto true curve_role
DisplayOrder display_order Display Order int 70    
Version version Version int 70    
ModifiedBy modified_by Modified By string auto    
RecordedAt recorded_at Recorded At timestamp auto    

6.8. Custom repository methods

7. See also

Emacs 29.3 (Org mode 9.6.15)