ores.trading.fra_instrument
Table of Contents
Represents a Forward Rate Agreement instrument that fixes a future interest rate for a notional principal amount over a specified period.
1. Flags
2. Natural keys
3. Columns
3.1. instrument_id
UUID uniquely identifying this FRA instrument.
Surrogate key for the instrument record.
3.2. trade_type_code
Trade type code (soft FK to ores_trading_trade_types_tbl).
std::string("FRA")
3.3. party_id
Party that owns this instrument.
Set from session variable app.current_party_id.
3.4. trade_id
Optional soft FK to the parent trade.
Links instrument to a trade if applicable.
3.5. start_date
FRA start date.
ISO 8601 date string (YYYY-MM-DD).
std::string("2024-01-15")
3.6. end_date
FRA end date.
Must be after start_date.
std::string("2025-01-15")
3.7. currency
ISO 4217 currency code.
e.g., USD, EUR, GBP.
std::string("USD")
3.8. rate_index
Floating rate index code.
e.g., LIBOR, EURIBOR, SOFR.
std::string("SOFR")
3.9. long_short
Position direction: Long or Short.
Indicates whether the party is a buyer (Long) or seller (Short).
std::string("Long")
3.10. strike
Fixed contract rate.
Expressed as a decimal fraction.
0.05
3.11. notional
Notional principal amount.
Must be positive.
1000000.0
3.12. description
Optional free-text description.
Human-readable notes about this instrument.
4. SQL
4.1. Flags
4.2. Checks
| expression |
|---|
| "end_date" > "start_date" |
| "notional" > 0 |
| "currency" <> '' |
| "rate_index" <> '' |
| "long_short" in ('Long', 'Short') |
4.3. Indexes
| name | columns | unique | current_only | where_extra |
|---|---|---|---|---|
| party | tenant_id, party_id | false | true | |
| trade_id | tenant_id, trade_id | true | true | trade_id is not null |
5. Insert trigger
5.1. Validations
| column | validation_function |
|---|---|
| trade_type_code | ores_trading_validate_trade_type_fn |
6. C++
The C++ domain class is decomposed into nested sub-structs (the C1202
pattern from PRs #1047/#1071/#1075/#1083/#1085): the implicit scaffolding
columns (version, tenant_id, workspace_id, the primary key) and the
columns marked :group: identity below fold into an
instrument_identity identity; member (see the
ores.trading.instrument_identity field-group model), the implicit audit
columns fold into an ores::dq::domain::audit_record audit; member (see
the ores.dq.audit_record field-group model), and the remaining columns
stay flat in between. The SQL schema, DB entity and column lists are
unaffected — only the domain class and the mapper's domain-side accesses
nest. The entity templates consume these annotations; domain and
repository profiles regenerate correctly.
6.1. Flags
6.2. Repository
6.3. Domain includes
#include <chrono> #include <string>
6.4. Conventions
6.5. Table display
| column | header |
|---|---|
| identity.instrument_id | ID |
| identity.trade_type_code | Type |
| start_date | Start Date |
| end_date | End Date |
| currency | Currency |
| rate_index | Rate Index |
| long_short | Long/Short |
| strike | Strike |
| notional | Notional |
| audit.recorded_at | Recorded At |
6.6. Custom repository methods
7. See also
- ores.trading — component group overview.