ores.trading.trade

Table of Contents

Temporal trade record. Each lifecycle event (New, Amendment, Novation, etc.) creates a new temporal row for the same trade id. The internal party is derived from book_id via books.party_id.

Flags

Primary key

UUID uniquely identifying this trade.

Surrogate key for the trade record.

Natural keys

Columns

party_id

Internal party owning this trade (denormalized from book_id).

boost::uuids::random_generator()()

external_id

Optional external trade identifier.

e.g., UTI prefix or legacy system ID.

std::string()

book_id

Book that owns this trade.

Soft FK to ores_refdata_books_tbl.

ctx.generate_uuid()

portfolio_id

Portfolio this trade belongs to.

Soft FK to ores_refdata_portfolios_tbl.

ctx.generate_uuid()

successor_trade_id

UUID of the trade that replaced this one (e.g., after novation).

Self-referencing soft FK. Absent for active trades.

std::nullopt

trade_type

ORE instrument type code (e.g. Swap, FxForward, CapFloor).

Soft FK to ores_trading_trade_types_tbl.

std::string("Swap")

counterparty_id

Optional counterparty (soft FK to ores_refdata_counterparties_tbl).

std::nullopt

product_type

ORE product type discriminator.

std::string("Swap")

instrument_id

Optional instrument record for this trade.

std::nullopt

asset_class

Asset class code for the trade.

std::nullopt

netting_set_id

Netting set identifier for ORE aggregation.

Groups trades under the same netting agreement.

std::string("NS-001")

activity_type_code

Activity type code (soft FK to ores_trading_activity_types_tbl).

std::string("New")

status_id

Current FSM state (soft FK to ores_dq_fsm_states_tbl).

boost::uuids::random_generator()()

trade_date

Date the trade was agreed.

ISO 8601 date: YYYY-MM-DD.

std::string("2025-01-15")

execution_timestamp

Timestamp when the trade was executed (with timezone).

ISO 8601 timestamp: YYYY-MM-DD HH:MM:SS+TZ.

std::string("2025-01-15 10:00:00")

effective_date

Date from which the trade is effective.

ISO 8601 date: YYYY-MM-DD.

std::string("2025-01-16")

termination_date

Date on which the trade matures or terminates.

ISO 8601 date: YYYY-MM-DD.

std::string("2026-01-15")

SQL

Flags

C++

Flags

Repository

Domain includes

#include <chrono>
#include <optional>
#include <string>
#include <boost/uuid/uuid.hpp>

Conventions

Table display

column header
identity.id ID
lifecycle.trade_date Trade Date
classification.trade_type Type
audit.modified_by Modified By
identity.version Version

Qt

Detail fields

field label widget type is_key is_required placeholder
external_id External ID externalIdEdit line_edit true   Enter external trade ID (e.g., UTI)
trade_type Trade Type tradeTypeEdit line_edit   true e.g., Swap, FxForward
netting_set_id Netting Set nettingSetIdEdit line_edit     e.g., NS-001
trade_date Trade Date tradeDateEdit line_edit   true YYYY-MM-DD
effective_date Effective Date effectiveDateEdit line_edit   true YYYY-MM-DD
termination_date Termination Date terminationDateEdit line_edit   true YYYY-MM-DD
execution_timestamp Execution Timestamp executionTimestampEdit line_edit     YYYY-MM-DD HH:MM:SS

Columns (Qt model)

enum_name field header type width
ExternalId external_id External ID string 180
TradeType trade_type Type string 120
TradeDate trade_date Trade Date string 110
EffectiveDate effective_date Effective string 110
TerminationDate termination_date Termination string 110
NettingSetId netting_set_id Netting Set string 120
Version version Version int 80
ModifiedBy modified_by Modified By string 120
RecordedAt recorded_at Recorded At timestamp 150

Custom repository methods

See also

Emacs 29.1 (Org mode 9.6.6)