Getting rid of Jetfix's platform, using Security.proto's exchange

This commit is contained in:
Taha Afzal committed 2023-02-05 20:24:29 -05:00
1 parent cc8c181728
commit 4dc675eb9c
4 files changed
+22 -26

No files matched your search

@@ -200,8 +200,8 @@ void AdminServiceUtils::fill_connections_from_config(
connection.set_id(new_id);
connection.set_name(c.name());
switch (c.platform()) {
case config::JetFIX::Connection::GLBX:
switch (c.venue()) {
case bts::api::VENUE_GLBX:
if (c.cme_market_segment_id() == 0)
connection.mutable_cme_connection()->mutable_cgw_connection();
else
@@ -210,18 +210,20 @@ void AdminServiceUtils::fill_connections_from_config(
->set_market_segment_id(c.cme_market_segment_id());
add_connection(admin_data, connection);
break;
case config::JetFIX::Connection::CBOE:
case bts::api::VENUE_CBOE:
break;
case config::JetFIX::Connection::SIM:
case config::JetFIX::Connection::SIMICE:
// /case bts::api::VENUE_ICE:
case bts::api::VENUE_SIMICE:
connection.mutable_sim_connection();
add_connection(admin_data, connection);
break;
case config::JetFIX::Connection::ICE:
case bts::api::VENUE_ICE:
connection.mutable_ice_connection()->set_sender_compid(
c.sender_compid());
add_connection(admin_data, connection);
break;
default:
break;
}
}
for (int i = 0; i < admin_data.accounts_size(); i++)
@@ -698,7 +700,7 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(
rv.set_customer_or_firm(sim_account_data->origin());
return rv;
} break;
case api::VENUE_FTX: // TODO
case api::VENUE_FTX: // TODO
case api::VENUE_BINANCE: // TODO
case api::VENUE_BINANCE_US:
case api::VENUE_BINANCE_USDS_FUTURES:
-9
View File
@@ -7,15 +7,6 @@ message JetFIX {
// a friendly name used to represent this session in the UI
required string name = 10;
enum JetFIXPlatform {
GLBX = 1;
CBOE = 6;
SIM = 2;
ICE = 3;
SIMICE = 4;
}
optional JetFIXPlatform platform = 15 [ default = GLBX ];
// the ip address to connect to
required string socket_connect_host_ip = 30;
+3 -4
View File
@@ -1,6 +1,7 @@
#include "Session.h"
#include "lib/config/config.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/jetfix/codec/FIXEncodingStream.h"
#include "lib/jetfix/codec/FieldDefinitions.h"
#include "lib/jetfix/codec/MessageTypes.h"
@@ -801,10 +802,8 @@ OutFIXPtr make_logon(
const char *application = "O2";
#endif
if (session_cfg.platform() ==
bts::config::JetFIX_Connection_JetFIXPlatform_ICE ||
session_cfg.platform() ==
bts::config::JetFIX_Connection_JetFIXPlatform_SIMICE) {
if (session_cfg.venue() == bts::api::VENUE_ICE ||
session_cfg.venue() == bts::api::VENUE_SIMICE) {
std::string sender_comp_id = session_cfg.sender_subid();
buffer.add<ICEApplicationSystemName>(sender_comp_id);
buffer.add<ICEApplicationSystemVersion>(std::string_view{"1.0"});
@@ -1,4 +1,5 @@
#include "ExecutionGatewayFactory.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/md/SecurityOracle.h"
#include "lib/orderman/gateways/CCAPIExecutionGateway.h"
#include "lib/orderman/gateways/EMExecutionGateway.h"
@@ -6,9 +7,11 @@
#include "lib/orderman/gateways/GLBXExecutionGateway.h"
#include "lib/orderman/gateways/GLBXiLink3ExecutionGateway.h"
#include "lib/orderman/gateways/ICEExecutionGateway.h"
#include "lib/orderman/gateways/sim/SimExecutionGatewayUniqueWrapper.h"
#include "lib/tracing/PerfLog.h"
#include "lib/utils/PBUtils.h"
#include "lib/utils/ValueWrapper.h"
#include <memory>
#include <variant>
namespace bts::orderman {
@@ -20,17 +23,18 @@ std::unique_ptr<IExecutionGateway> ExecutionGatewayFactory::create_gateway(
// check which exchanges are set to Sim
LOG(OrderMan, Info, "ExecutionGatewayFactory::create_gateway conn: {}",
utils::pb::to_string(conn));
if (conn.platform() == bts::config::JetFIX_Connection_JetFIXPlatform_ICE ||
conn.platform() == bts::config::JetFIX_Connection_JetFIXPlatform_SIMICE)
if (conn.venue() == bts::api::VENUE_ICE ||
conn.venue() == bts::api::VENUE_SIMICE)
return std::make_unique<ICEExecutionGateway>(conn, pl, o);
else if (conn.platform() == bts::config::JetFIX::Connection::GLBX) {
else if (conn.venue() == bts::api::VENUE_GLBX) {
if (conn.use_ilink3())
return std::make_unique<ilink3::GLBXiLink3ExecutionGateway>(
conn, pl, o);
return std::make_unique<GLBXExecutionGateway>(conn, pl, o);
} else
//return std::make_unique<CCAPIExecutionGateway>(o);
return std::make_unique<EMExecutionGateway>(o);
} else if (conn.venue() == bts::api::VENUE_DERIBIT)
return std::make_unique<SimExecutionGatewayUniqueWrapper>(conn.venue());
//return std::make_unique<CCAPIExecutionGateway>(o);
return std::make_unique<EMExecutionGateway>(o);
// return std::make_unique<FakeExecutionGateway>(o);
// return std::make_unique<GLBXExecutionGateway>(conn, pl, o);
}