20#ifndef ORES_TRADING_MESSAGING_INSTRUMENT_PROTOCOL_HPP
21#define ORES_TRADING_MESSAGING_INSTRUMENT_PROTOCOL_HPP
25#include "ores.trading.api/domain/instrument.hpp"
26#include "ores.trading.api/domain/swap_leg.hpp"
27#include "ores.trading.api/domain/fx_instrument.hpp"
28#include "ores.trading.api/domain/bond_instrument.hpp"
29#include "ores.trading.api/domain/credit_instrument.hpp"
30#include "ores.trading.api/domain/equity_instrument.hpp"
31#include "ores.trading.api/domain/commodity_instrument.hpp"
32#include "ores.trading.api/domain/composite_instrument.hpp"
33#include "ores.trading.api/domain/composite_leg.hpp"
34#include "ores.trading.api/domain/scripted_instrument.hpp"
36namespace ores::trading::messaging {
38struct get_instruments_request {
39 using response_type =
struct get_instruments_response;
40 static constexpr std::string_view nats_subject =
"trading.v1.instruments.list";
45struct get_instruments_response {
46 std::vector<ores::trading::domain::instrument> instruments;
47 int total_available_count = 0;
52struct save_instrument_request {
53 using response_type =
struct save_instrument_response;
54 static constexpr std::string_view nats_subject =
"trading.v1.instruments.save";
56 std::vector<ores::trading::domain::swap_leg> legs;
59struct save_instrument_response {
64struct delete_instrument_request {
65 using response_type =
struct delete_instrument_response;
66 static constexpr std::string_view nats_subject =
"trading.v1.instruments.delete";
67 std::vector<std::string> ids;
70struct delete_instrument_response {
75struct get_instrument_history_request {
76 using response_type =
struct get_instrument_history_response;
77 static constexpr std::string_view nats_subject =
"trading.v1.instruments.history";
81struct get_instrument_history_response {
84 std::vector<ores::trading::domain::instrument> history;
87struct get_swap_legs_request {
88 using response_type =
struct get_swap_legs_response;
89 static constexpr std::string_view nats_subject =
"trading.v1.instruments.legs.list";
90 std::string instrument_id;
93struct get_swap_legs_response {
94 std::vector<ores::trading::domain::swap_leg> legs;
101struct get_fx_instruments_request {
102 using response_type =
struct get_fx_instruments_response;
103 static constexpr std::string_view nats_subject =
104 "trading.v1.fx_instruments.list";
109struct get_fx_instruments_response {
110 std::vector<ores::trading::domain::fx_instrument> instruments;
111 int total_available_count = 0;
116struct save_fx_instrument_request {
117 using response_type =
struct save_fx_instrument_response;
118 static constexpr std::string_view nats_subject =
119 "trading.v1.fx_instruments.save";
123struct save_fx_instrument_response {
124 bool success =
false;
128struct delete_fx_instrument_request {
129 using response_type =
struct delete_fx_instrument_response;
130 static constexpr std::string_view nats_subject =
131 "trading.v1.fx_instruments.delete";
132 std::vector<std::string> ids;
135struct delete_fx_instrument_response {
136 bool success =
false;
138 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
141struct get_fx_instrument_history_request {
142 using response_type =
struct get_fx_instrument_history_response;
143 static constexpr std::string_view nats_subject =
144 "trading.v1.fx_instruments.history";
148struct get_fx_instrument_history_response {
149 bool success =
false;
151 std::vector<ores::trading::domain::fx_instrument> history;
156struct get_bond_instruments_request {
157 using response_type =
struct get_bond_instruments_response;
158 static constexpr std::string_view nats_subject =
159 "trading.v1.bond_instruments.list";
164struct get_bond_instruments_response {
165 std::vector<ores::trading::domain::bond_instrument> instruments;
166 int total_available_count = 0;
171struct save_bond_instrument_request {
172 using response_type =
struct save_bond_instrument_response;
173 static constexpr std::string_view nats_subject =
174 "trading.v1.bond_instruments.save";
178struct save_bond_instrument_response {
179 bool success =
false;
183struct delete_bond_instrument_request {
184 using response_type =
struct delete_bond_instrument_response;
185 static constexpr std::string_view nats_subject =
186 "trading.v1.bond_instruments.delete";
187 std::vector<std::string> ids;
190struct delete_bond_instrument_response {
191 bool success =
false;
193 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
196struct get_bond_instrument_history_request {
197 using response_type =
struct get_bond_instrument_history_response;
198 static constexpr std::string_view nats_subject =
199 "trading.v1.bond_instruments.history";
203struct get_bond_instrument_history_response {
204 bool success =
false;
206 std::vector<ores::trading::domain::bond_instrument> history;
211struct get_credit_instruments_request {
212 using response_type =
struct get_credit_instruments_response;
213 static constexpr std::string_view nats_subject =
214 "trading.v1.credit_instruments.list";
219struct get_credit_instruments_response {
220 std::vector<ores::trading::domain::credit_instrument> instruments;
221 int total_available_count = 0;
226struct save_credit_instrument_request {
227 using response_type =
struct save_credit_instrument_response;
228 static constexpr std::string_view nats_subject =
229 "trading.v1.credit_instruments.save";
233struct save_credit_instrument_response {
234 bool success =
false;
238struct delete_credit_instrument_request {
239 using response_type =
struct delete_credit_instrument_response;
240 static constexpr std::string_view nats_subject =
241 "trading.v1.credit_instruments.delete";
242 std::vector<std::string> ids;
245struct delete_credit_instrument_response {
246 bool success =
false;
248 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
251struct get_credit_instrument_history_request {
252 using response_type =
struct get_credit_instrument_history_response;
253 static constexpr std::string_view nats_subject =
254 "trading.v1.credit_instruments.history";
258struct get_credit_instrument_history_response {
259 bool success =
false;
261 std::vector<ores::trading::domain::credit_instrument> history;
266struct get_equity_instruments_request {
267 using response_type =
struct get_equity_instruments_response;
268 static constexpr std::string_view nats_subject =
269 "trading.v1.equity_instruments.list";
274struct get_equity_instruments_response {
275 std::vector<ores::trading::domain::equity_instrument> instruments;
276 int total_available_count = 0;
281struct save_equity_instrument_request {
282 using response_type =
struct save_equity_instrument_response;
283 static constexpr std::string_view nats_subject =
284 "trading.v1.equity_instruments.save";
288struct save_equity_instrument_response {
289 bool success =
false;
293struct delete_equity_instrument_request {
294 using response_type =
struct delete_equity_instrument_response;
295 static constexpr std::string_view nats_subject =
296 "trading.v1.equity_instruments.delete";
297 std::vector<std::string> ids;
300struct delete_equity_instrument_response {
301 bool success =
false;
303 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
306struct get_equity_instrument_history_request {
307 using response_type =
struct get_equity_instrument_history_response;
308 static constexpr std::string_view nats_subject =
309 "trading.v1.equity_instruments.history";
313struct get_equity_instrument_history_response {
314 bool success =
false;
316 std::vector<ores::trading::domain::equity_instrument> history;
321struct get_commodity_instruments_request {
322 using response_type =
struct get_commodity_instruments_response;
323 static constexpr std::string_view nats_subject =
324 "trading.v1.commodity_instruments.list";
329struct get_commodity_instruments_response {
330 std::vector<ores::trading::domain::commodity_instrument> instruments;
331 int total_available_count = 0;
336struct save_commodity_instrument_request {
337 using response_type =
struct save_commodity_instrument_response;
338 static constexpr std::string_view nats_subject =
339 "trading.v1.commodity_instruments.save";
343struct save_commodity_instrument_response {
344 bool success =
false;
348struct delete_commodity_instrument_request {
349 using response_type =
struct delete_commodity_instrument_response;
350 static constexpr std::string_view nats_subject =
351 "trading.v1.commodity_instruments.delete";
352 std::vector<std::string> ids;
355struct delete_commodity_instrument_response {
356 bool success =
false;
358 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
361struct get_commodity_instrument_history_request {
362 using response_type =
struct get_commodity_instrument_history_response;
363 static constexpr std::string_view nats_subject =
364 "trading.v1.commodity_instruments.history";
368struct get_commodity_instrument_history_response {
369 bool success =
false;
371 std::vector<ores::trading::domain::commodity_instrument> history;
376struct get_composite_instrument_legs_request {
377 using response_type =
struct get_composite_instrument_legs_response;
378 static constexpr std::string_view nats_subject =
379 "trading.v1.composite_instruments.legs.list";
380 std::string instrument_id;
383struct get_composite_instrument_legs_response {
384 std::vector<ores::trading::domain::composite_leg> legs;
389struct get_composite_instruments_request {
390 using response_type =
struct get_composite_instruments_response;
391 static constexpr std::string_view nats_subject =
392 "trading.v1.composite_instruments.list";
397struct get_composite_instruments_response {
398 std::vector<ores::trading::domain::composite_instrument> instruments;
399 int total_available_count = 0;
404struct save_composite_instrument_request {
405 using response_type =
struct save_composite_instrument_response;
406 static constexpr std::string_view nats_subject =
407 "trading.v1.composite_instruments.save";
409 std::vector<ores::trading::domain::composite_leg> legs;
412struct save_composite_instrument_response {
413 bool success =
false;
417struct delete_composite_instrument_request {
418 using response_type =
struct delete_composite_instrument_response;
419 static constexpr std::string_view nats_subject =
420 "trading.v1.composite_instruments.delete";
421 std::vector<std::string> ids;
424struct delete_composite_instrument_response {
425 bool success =
false;
427 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
430struct get_composite_instrument_history_request {
431 using response_type =
struct get_composite_instrument_history_response;
432 static constexpr std::string_view nats_subject =
433 "trading.v1.composite_instruments.history";
437struct get_composite_instrument_history_response {
438 bool success =
false;
440 std::vector<ores::trading::domain::composite_instrument> history;
445struct get_scripted_instruments_request {
446 using response_type =
struct get_scripted_instruments_response;
447 static constexpr std::string_view nats_subject =
448 "trading.v1.scripted_instruments.list";
453struct get_scripted_instruments_response {
454 std::vector<ores::trading::domain::scripted_instrument> instruments;
455 int total_available_count = 0;
460struct save_scripted_instrument_request {
461 using response_type =
struct save_scripted_instrument_response;
462 static constexpr std::string_view nats_subject =
463 "trading.v1.scripted_instruments.save";
467struct save_scripted_instrument_response {
468 bool success =
false;
472struct delete_scripted_instrument_request {
473 using response_type =
struct delete_scripted_instrument_response;
474 static constexpr std::string_view nats_subject =
475 "trading.v1.scripted_instruments.delete";
476 std::vector<std::string> ids;
479struct delete_scripted_instrument_response {
480 bool success =
false;
482 std::vector<std::pair<std::string, std::pair<bool, std::string>>> results;
485struct get_scripted_instrument_history_request {
486 using response_type =
struct get_scripted_instrument_history_response;
487 static constexpr std::string_view nats_subject =
488 "trading.v1.scripted_instruments.history";
492struct get_scripted_instrument_history_response {
493 bool success =
false;
495 std::vector<ores::trading::domain::scripted_instrument> history;
Bond instrument economics for Bond, ForwardBond, CallableBond, ConvertibleBond, and BondRepo trades.
Definition bond_instrument.hpp:38
Commodity instrument economics for all commodity ORE product types.
Definition commodity_instrument.hpp:48
Composite instrument economics for CompositeTrade and MultiLegOption ORE product types.
Definition composite_instrument.hpp:37
Credit instrument economics for CreditDefaultSwap, CDSIndex, SyntheticCDO, CreditDefaultSwapOption,...
Definition credit_instrument.hpp:39
Equity instrument economics for all equity ORE product types.
Definition equity_instrument.hpp:45
FX instrument economics for FxForward, FxSwap, and FxOption trades.
Definition fx_instrument.hpp:36
Parent instrument record holding economic terms for a trade.
Definition instrument.hpp:40
Scripted instrument economics for ORE AMC script-based product types.
Definition scripted_instrument.hpp:38