diff --git a/src/lib/api/service_helpers/AdminServiceUtils.cpp b/src/lib/api/service_helpers/AdminServiceUtils.cpp index 946adaad4..d7790b73d 100644 --- a/src/lib/api/service_helpers/AdminServiceUtils.cpp +++ b/src/lib/api/service_helpers/AdminServiceUtils.cpp @@ -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: diff --git a/src/lib/config/protos/jetfix.proto b/src/lib/config/protos/jetfix.proto index a00eeadc0..b0c984621 100644 --- a/src/lib/config/protos/jetfix.proto +++ b/src/lib/config/protos/jetfix.proto @@ -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; diff --git a/src/lib/jetfix/gateway/Session.cpp b/src/lib/jetfix/gateway/Session.cpp index 1c6b29550..c0dff4416 100644 --- a/src/lib/jetfix/gateway/Session.cpp +++ b/src/lib/jetfix/gateway/Session.cpp @@ -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(sender_comp_id); buffer.add(std::string_view{"1.0"}); diff --git a/src/lib/orderman/gateways/ExecutionGatewayFactory.cpp b/src/lib/orderman/gateways/ExecutionGatewayFactory.cpp index c9bfa53c1..3203af658 100644 --- a/src/lib/orderman/gateways/ExecutionGatewayFactory.cpp +++ b/src/lib/orderman/gateways/ExecutionGatewayFactory.cpp @@ -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 #include namespace bts::orderman { @@ -20,17 +23,18 @@ std::unique_ptr 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(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( conn, pl, o); return std::make_unique(conn, pl, o); - } else - //return std::make_unique(o); - return std::make_unique(o); + } else if (conn.venue() == bts::api::VENUE_DERIBIT) + return std::make_unique(conn.venue()); + //return std::make_unique(o); + return std::make_unique(o); // return std::make_unique(o); // return std::make_unique(conn, pl, o); }