From e8c910e52d1807e2fcca3b43d80a9df6acac5387 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Wed, 12 Jan 2022 06:26:46 +0000
Subject: [PATCH] write price level to each book

---
 json.hpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/json.hpp b/json.hpp
index adcb147..45bf855 100644
--- a/json.hpp
+++ b/json.hpp
@@ -25,10 +25,11 @@
 	BROKER_REQUEST,
 	BROKER_ACK,
 	BROKER_CONFIRM,
+	ERROR,
 	NONE
 };
 
-enum TradeTypeEnum { BUY_AGGRESSOR, SELL_AGGRESSOR };
+enum TradeTypeEnum { BUY_AGGRESSOR, SELL_AGGRESSOR, BROKER_TRADE };
 
 struct Message {
 	MessageTypes type;
@@ -36,6 +37,12 @@
 	Message(MessageTypes type, std::string product);
 	Message();
 	virtual ~Message() = default;
+};
+
+struct ErrorMessage : public Message {
+	std::string message;
+	ErrorMessage(std::string message);
+	std::string as_string();
 };
 
 struct FromExchange : public Message {
@@ -104,6 +111,7 @@
 	AddedMessage(MessageTypes type, std::string product, std::string id,
 	             book::OrderSideEnum side, double price, uint64_t filled,
 	             uint64_t resting, uint64_t sequence, double timestamp);
+	std::string as_string();
 };
 
 struct DeleteMessage : public ToExchange {
@@ -118,12 +126,14 @@
 	DeletedMessage(MessageTypes type, std::string product, std::string id,
 	               book::OrderSideEnum side, uint64_t sequence,
 	               double timestamp);
+	std::string as_string();
 };
 
 struct RejectMessage : public FromExchange {
 	std::string error;
 	RejectMessage(MessageTypes type, std::string product, std::string error,
 	              uint64_t sequence, double timestamp);
+	std::string as_string();
 };
 
 struct TradeMessage : public FromExchange {

--
Gitblit v1.9.3