ORE Studio 0.0.4
Loading...
Searching...
No Matches
bond_instrument.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_TRADING_DOMAIN_BOND_INSTRUMENT_HPP
21#define ORES_TRADING_DOMAIN_BOND_INSTRUMENT_HPP
22
23#include <chrono>
24#include <string>
25#include <optional>
26#include <boost/uuid/uuid.hpp>
27#include "ores.utility/uuid/tenant_id.hpp"
28
29namespace ores::trading::domain {
30
38struct bond_instrument final {
42 int version = 0;
43
48
52 boost::uuids::uuid instrument_id;
53
57 boost::uuids::uuid party_id;
58
64 std::optional<boost::uuids::uuid> trade_id;
65
71 std::string trade_type_code;
72
76 std::string security_id;
77
81 std::string issuer;
82
86 std::string currency;
87
91 double face_value = 0.0;
92
96 double coupon_rate = 0.0;
97
102
106 std::string day_count_code;
107
111 std::string issue_date;
112
116 std::string maturity_date;
117
122
127 std::string call_date;
128
133 double conversion_ratio = 0.0;
134
138 std::string description;
139
143 std::string modified_by;
144
148 std::string performed_by;
149
154
158 std::string change_commentary;
159
163 std::chrono::system_clock::time_point recorded_at;
164
165 // -------------------------------------------------------------------------
166 // Phase 7 extensions: BondFuture, BondOption, BondTRS, Ascot
167 // -------------------------------------------------------------------------
168
173
177 std::string option_type;
178
183
187 std::optional<double> option_strike;
188
193 std::string trs_return_type;
194
199
203 std::string ascot_option_type;
204};
205
206}
207
208#endif
Bond instrument economics for Bond, ForwardBond, CallableBond, ConvertibleBond, and BondRepo trades.
Definition bond_instrument.hpp:38
std::string option_type
Option type for BondOption: "Call" or "Put". Empty otherwise.
Definition bond_instrument.hpp:177
double coupon_rate
Annual coupon rate as a decimal (e.g. 0.05 for 5%).
Definition bond_instrument.hpp:96
std::string modified_by
Username of the person who last modified this record.
Definition bond_instrument.hpp:143
boost::uuids::uuid instrument_id
UUID uniquely identifying this bond instrument.
Definition bond_instrument.hpp:52
std::optional< boost::uuids::uuid > trade_id
UUID of the associated trade record.
Definition bond_instrument.hpp:64
std::string change_commentary
Free-text commentary explaining the change.
Definition bond_instrument.hpp:158
std::string coupon_frequency_code
Payment frequency code (e.g. Annual, SemiAnnual, Quarterly).
Definition bond_instrument.hpp:101
std::string description
Optional free-text description.
Definition bond_instrument.hpp:138
double face_value
Face (notional) value of the bond.
Definition bond_instrument.hpp:91
std::string ascot_option_type
ASCOT option type. Empty for non-Ascot products.
Definition bond_instrument.hpp:203
boost::uuids::uuid party_id
Party that owns this instrument.
Definition bond_instrument.hpp:57
double conversion_ratio
Optional conversion ratio for convertible bonds. Zero for non-convertible products.
Definition bond_instrument.hpp:133
int settlement_days
Optional number of settlement days. Zero means not specified.
Definition bond_instrument.hpp:121
std::chrono::system_clock::time_point recorded_at
Timestamp when this version of the record was recorded.
Definition bond_instrument.hpp:163
std::string security_id
Security identifier (e.g. ISIN) for the bond.
Definition bond_instrument.hpp:76
std::string call_date
Optional call date for callable bonds (ISO 8601). Empty for non-callable products.
Definition bond_instrument.hpp:127
int version
Version number for optimistic locking and change tracking.
Definition bond_instrument.hpp:42
std::string day_count_code
Day count convention code (e.g. Actual365Fixed, Thirty360).
Definition bond_instrument.hpp:106
std::string trs_funding_leg_code
Funding leg floating index code for BondTRS. Empty otherwise.
Definition bond_instrument.hpp:198
std::string issue_date
Issue date (ISO 8601 date string, e.g. 2026-01-15).
Definition bond_instrument.hpp:111
std::string issuer
Name of the bond issuer.
Definition bond_instrument.hpp:81
std::string maturity_date
Maturity date (ISO 8601 date string, e.g. 2036-01-15).
Definition bond_instrument.hpp:116
std::string performed_by
Username of the account that performed this action.
Definition bond_instrument.hpp:148
std::string trs_return_type
Return type for BondTRS: "TotalReturn" or "PriceReturn". Empty otherwise.
Definition bond_instrument.hpp:193
std::optional< double > option_strike
Option strike as clean price for BondOption. Null when not set.
Definition bond_instrument.hpp:187
std::string future_expiry_date
Delivery date for BondFuture. Empty for other types.
Definition bond_instrument.hpp:172
std::string trade_type_code
ORE product type code (Bond, ForwardBond, CallableBond, ConvertibleBond, BondRepo,...
Definition bond_instrument.hpp:71
utility::uuid::tenant_id tenant_id
Tenant identifier for multi-tenancy isolation.
Definition bond_instrument.hpp:47
std::string change_reason_code
Code identifying the reason for the change.
Definition bond_instrument.hpp:153
std::string currency
ISO 4217 currency code (e.g. USD).
Definition bond_instrument.hpp:86
std::string option_expiry_date
Option expiry date for BondOption (ISO 8601). Empty otherwise.
Definition bond_instrument.hpp:182
A strongly-typed wrapper around a UUID representing a tenant identifier.
Definition tenant_id.hpp:66
static tenant_id system()
Creates a tenant_id representing the system tenant.
Definition tenant_id.cpp:41