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 id;
53
59 std::string trade_type_code;
60
64 std::string issuer;
65
69 std::string currency;
70
74 double face_value = 0.0;
75
79 double coupon_rate = 0.0;
80
85
89 std::string day_count_code;
90
94 std::string issue_date;
95
99 std::string maturity_date;
100
105
110 std::string call_date;
111
116 double conversion_ratio = 0.0;
117
121 std::string description;
122
126 std::string modified_by;
127
131 std::string performed_by;
132
137
141 std::string change_commentary;
142
146 std::chrono::system_clock::time_point recorded_at;
147
148 // -------------------------------------------------------------------------
149 // Phase 7 extensions: BondFuture, BondOption, BondTRS, Ascot
150 // -------------------------------------------------------------------------
151
156
160 std::string option_type;
161
166
170 std::optional<double> option_strike;
171
176 std::string trs_return_type;
177
182
186 std::string ascot_option_type;
187};
188
189}
190
191#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:160
double coupon_rate
Annual coupon rate as a decimal (e.g. 0.05 for 5%).
Definition bond_instrument.hpp:79
std::string modified_by
Username of the person who last modified this record.
Definition bond_instrument.hpp:126
std::string change_commentary
Free-text commentary explaining the change.
Definition bond_instrument.hpp:141
std::string coupon_frequency_code
Payment frequency code (e.g. Annual, SemiAnnual, Quarterly).
Definition bond_instrument.hpp:84
std::string description
Optional free-text description.
Definition bond_instrument.hpp:121
double face_value
Face (notional) value of the bond.
Definition bond_instrument.hpp:74
std::string ascot_option_type
ASCOT option type. Empty for non-Ascot products.
Definition bond_instrument.hpp:186
double conversion_ratio
Optional conversion ratio for convertible bonds. Zero for non-convertible products.
Definition bond_instrument.hpp:116
int settlement_days
Optional number of settlement days. Zero means not specified.
Definition bond_instrument.hpp:104
std::chrono::system_clock::time_point recorded_at
Timestamp when this version of the record was recorded.
Definition bond_instrument.hpp:146
std::string call_date
Optional call date for callable bonds (ISO 8601). Empty for non-callable products.
Definition bond_instrument.hpp:110
boost::uuids::uuid id
UUID uniquely identifying this bond instrument.
Definition bond_instrument.hpp:52
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:89
std::string trs_funding_leg_code
Funding leg floating index code for BondTRS. Empty otherwise.
Definition bond_instrument.hpp:181
std::string issue_date
Issue date (ISO 8601 date string, e.g. 2026-01-15).
Definition bond_instrument.hpp:94
std::string issuer
Name of the bond issuer.
Definition bond_instrument.hpp:64
std::string maturity_date
Maturity date (ISO 8601 date string, e.g. 2036-01-15).
Definition bond_instrument.hpp:99
std::string performed_by
Username of the account that performed this action.
Definition bond_instrument.hpp:131
std::string trs_return_type
Return type for BondTRS: "TotalReturn" or "PriceReturn". Empty otherwise.
Definition bond_instrument.hpp:176
std::optional< double > option_strike
Option strike as clean price for BondOption. Null when not set.
Definition bond_instrument.hpp:170
std::string future_expiry_date
Delivery date for BondFuture. Empty for other types.
Definition bond_instrument.hpp:155
std::string trade_type_code
ORE product type code (Bond, ForwardBond, CallableBond, ConvertibleBond, BondRepo,...
Definition bond_instrument.hpp:59
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:136
std::string currency
ISO 4217 currency code (e.g. USD).
Definition bond_instrument.hpp:69
std::string option_expiry_date
Option expiry date for BondOption (ISO 8601). Empty otherwise.
Definition bond_instrument.hpp:165
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