ORE Studio 0.0.4
Loading...
Searching...
No Matches
equity_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_EQUITY_INSTRUMENT_HPP
21#define ORES_TRADING_DOMAIN_EQUITY_INSTRUMENT_HPP
22
23#include <chrono>
24#include <string>
25#include <boost/uuid/uuid.hpp>
26#include "ores.utility/uuid/tenant_id.hpp"
27
28namespace ores::trading::domain {
29
45struct equity_instrument final {
49 int version = 0;
50
55
59 boost::uuids::uuid id;
60
64 std::string trade_type_code;
65
69 std::string underlying_code;
70
74 std::string currency;
75
79 double notional = 0.0;
80
84 double quantity = 0.0;
85
89 std::string start_date;
90
94 std::string maturity_date;
95
99 std::string option_type;
100
104 double strike_price = 0.0;
105
109 std::string exercise_type;
110
114 std::string barrier_type;
115
119 double lower_barrier = 0.0;
120
124 double upper_barrier = 0.0;
125
129 std::string average_type;
130
135
139 double variance_strike = 0.0;
140
145
150
154 double knock_out_barrier = 0.0;
155
159 std::string basket_json;
160
164 std::string day_count_code;
165
170
174 std::string return_type;
175
179 std::string description;
180
184 std::string modified_by;
185
189 std::string performed_by;
190
195
199 std::string change_commentary;
200
204 std::chrono::system_clock::time_point recorded_at;
205};
206
207}
208
209#endif
Equity instrument economics for all equity ORE product types.
Definition equity_instrument.hpp:45
std::string option_type
Option type: 'Call' or 'Put'. Empty for non-option products.
Definition equity_instrument.hpp:99
std::string modified_by
Username of the person who last modified this record.
Definition equity_instrument.hpp:184
std::string cliquet_frequency_code
Payment frequency code for cliquet options. Empty when not applicable.
Definition equity_instrument.hpp:144
std::string exercise_type
Exercise type: 'European', 'American', or 'Bermudan'.
Definition equity_instrument.hpp:109
std::string start_date
Start date for swaps, accumulators, and similar products.
Definition equity_instrument.hpp:89
std::string change_commentary
Free-text commentary explaining the change.
Definition equity_instrument.hpp:199
double notional
Contract notional or equity value.
Definition equity_instrument.hpp:79
std::string description
Optional free-text description.
Definition equity_instrument.hpp:179
std::string underlying_code
Underlying equity identifier (ticker/symbol, e.g. ".SPX", "AAPL").
Definition equity_instrument.hpp:69
double quantity
Number of shares or contracts. Used for position products.
Definition equity_instrument.hpp:84
double knock_out_barrier
Knock-out barrier level for accumulator products.
Definition equity_instrument.hpp:154
double upper_barrier
Upper barrier level. Zero when not applicable.
Definition equity_instrument.hpp:124
double lower_barrier
Lower barrier level. Zero when not applicable.
Definition equity_instrument.hpp:119
std::string average_type
Averaging type for Asian options: 'Arithmetic' or 'Geometric'.
Definition equity_instrument.hpp:129
std::chrono::system_clock::time_point recorded_at
Timestamp when this version of the record was recorded.
Definition equity_instrument.hpp:204
std::string averaging_start_date
Start of the averaging window for Asian options.
Definition equity_instrument.hpp:134
std::string return_type
Equity return type for swap products: 'TotalReturn' or 'PriceReturn'.
Definition equity_instrument.hpp:174
double strike_price
Option strike price. Zero for non-option products.
Definition equity_instrument.hpp:104
std::string basket_json
JSON array of {code, weight} constituents for basket/rainbow products.
Definition equity_instrument.hpp:159
std::string payment_frequency_code
Payment frequency code for swap products.
Definition equity_instrument.hpp:169
boost::uuids::uuid id
UUID uniquely identifying this equity instrument.
Definition equity_instrument.hpp:59
int version
Version number for optimistic locking and change tracking.
Definition equity_instrument.hpp:49
std::string day_count_code
Day count fraction code for swap products.
Definition equity_instrument.hpp:164
std::string maturity_date
Maturity/expiry date for options, swaps, and forwards.
Definition equity_instrument.hpp:94
std::string performed_by
Username of the account that performed this action.
Definition equity_instrument.hpp:189
double accumulation_amount
Per-fixing accumulation amount for accumulator products.
Definition equity_instrument.hpp:149
std::string trade_type_code
ORE product type code (EquityOption, EquitySwap, etc.).
Definition equity_instrument.hpp:64
utility::uuid::tenant_id tenant_id
Tenant identifier for multi-tenancy isolation.
Definition equity_instrument.hpp:54
std::string change_reason_code
Code identifying the reason for the change.
Definition equity_instrument.hpp:194
double variance_strike
Strike variance for variance swap products. Zero when not applicable.
Definition equity_instrument.hpp:139
std::string currency
ISO 4217 currency code.
Definition equity_instrument.hpp:74
std::string barrier_type
Barrier type: e.g. 'UpIn', 'UpOut', 'DownIn', 'DownOut'.
Definition equity_instrument.hpp:114
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