beginnings of ICE exec and SIMICE
This commit is contained in:
1 parent
9a7164b42b
commit
33eaf6f86d
22 files changed
+290
-92
No files matched your search
@@ -41,6 +41,7 @@ bool AdminServiceUtils::has_exchange(const ExchangeConnection& conn,
|
||||
break;
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_SIM:
|
||||
case api::Venue::VENUE_SIMICE:
|
||||
rv = conn.has_sim_connection();
|
||||
break;
|
||||
case api::Venue::VENUE_BTS:
|
||||
@@ -83,6 +84,23 @@ AdminServiceUtils::resolve_cme_connection(const bts::api::admin::AdminData& data
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::ExchangeConnection*
|
||||
AdminServiceUtils::resolve_ice_connection(const bts::api::admin::AdminData& data,
|
||||
const bts::api::admin::BTSAccount& account,
|
||||
const bts::api::Security&)
|
||||
{
|
||||
if(account.has_connections())
|
||||
{
|
||||
for (const std::string& conn_name : account.connections().exchange_connection_names())
|
||||
{
|
||||
const bts::api::admin::ExchangeConnection* conn = find_connection(data, conn_name);
|
||||
if (conn!=nullptr && conn->has_ice_connection())
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::ExchangeConnection*
|
||||
AdminServiceUtils::resolve_sim_connection(const bts::api::admin::AdminData& data,
|
||||
const bts::api::admin::BTSAccount& account,
|
||||
@@ -111,14 +129,22 @@ AdminServiceUtils::resolve_connection(const bts::api::admin::AdminData& data,
|
||||
rv = resolve_sim_connection(data, account, sec);
|
||||
break;
|
||||
}
|
||||
case api::Venue::VENUE_ICE:
|
||||
{
|
||||
rv = resolve_ice_connection(data, account, sec);
|
||||
auto deployment_type = boost::to_lower_copy(config::get<config::DeploymentType>().type());
|
||||
if (rv == nullptr && (deployment_type == "dev" || deployment_type == "demo"))
|
||||
rv = resolve_sim_connection(data, account, sec);
|
||||
break;
|
||||
}
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_SIM:
|
||||
case api::Venue::VENUE_SIMICE:
|
||||
rv = resolve_sim_connection(data, account, sec);
|
||||
break;
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::VENUE_ICE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
case api::Venue::Venue_INT_MAX_SENTINEL_DO_NOT_USE_:
|
||||
rv = nullptr;
|
||||
@@ -155,9 +181,15 @@ void AdminServiceUtils::fill_connections_from_config(bts::api::admin::AdminData&
|
||||
case config::JetFIX::Connection::CBOE:
|
||||
break;
|
||||
case config::JetFIX::Connection::SIM:
|
||||
case config::JetFIX::Connection::SIMICE:
|
||||
connection.mutable_sim_connection();
|
||||
add_connection(admin_data,connection);
|
||||
break;
|
||||
case config::JetFIX::Connection::ICE:
|
||||
connection.mutable_ice_connection();
|
||||
add_connection(admin_data,connection);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
for(int i=0;i<admin_data.accounts_size();i++)
|
||||
@@ -239,6 +271,18 @@ const bts::api::admin::CMEAccountData* AdminServiceUtils::get_account_cme_data(c
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::ICEAccountData* AdminServiceUtils::get_account_ice_data(const bts::api::admin::BTSAccount& account,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (account.has_exchange_account_data() && account.exchange_account_data().has_ice_account_data())
|
||||
return &(account.exchange_account_data().ice_account_data());
|
||||
else if (has_id(account.parent_account_id())){
|
||||
const bts::api::admin::BTSAccount* parent_account = find_account(data, account.parent_account_id());
|
||||
if (parent_account != nullptr)
|
||||
return get_account_ice_data (*parent_account, data);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::SIMAccountData* AdminServiceUtils::get_account_sim_data(const bts::api::admin::BTSAccount& account,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (account.has_exchange_account_data() && account.exchange_account_data().has_sim_account_data())
|
||||
@@ -274,7 +318,9 @@ std::string AdminServiceUtils::find_account_exchange_account (const bts::api::ad
|
||||
rv = cme_account_data->clearing_account();
|
||||
break;
|
||||
}
|
||||
case api::Venue::VENUE_SIM: {
|
||||
case api::Venue::VENUE_SIM:
|
||||
case api::Venue::VENUE_SIMICE:
|
||||
{
|
||||
auto sim_account_data = get_account_sim_data(account, data);
|
||||
if (sim_account_data != nullptr)
|
||||
rv = sim_account_data->clearing_account();
|
||||
@@ -384,6 +430,57 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(const bt
|
||||
return rv;
|
||||
}
|
||||
switch (sec.exchange()) {
|
||||
case api::Venue::VENUE_ICE:
|
||||
{
|
||||
const bts::api::admin::ICEUserData* ice_user_data = get_user_ice_data(*user_ptr, data);
|
||||
if(ice_user_data==nullptr)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("Could not find ICE data for user");
|
||||
return rv;
|
||||
}
|
||||
const bts::api::admin::ICEAccountData* ice_account_data = get_account_ice_data(*account_ptr, data);
|
||||
if(ice_account_data==nullptr)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("Could not find ICE data for account");
|
||||
return rv;
|
||||
}
|
||||
// check for data corectness
|
||||
if (ice_user_data->operator_id().length() == 0)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("Operator ID is not set");
|
||||
return rv;
|
||||
}
|
||||
if (ice_user_data->location().length() == 0)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("Location is not set");
|
||||
return rv;
|
||||
}
|
||||
if (ice_account_data->clearing_account().length() == 0)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("Clearing Account is not set");
|
||||
return rv;
|
||||
}
|
||||
if (ice_account_data->cti()==bts::api::orderman::CTICode::CTI_CODE_UNDEFINED)
|
||||
{
|
||||
out_result.set_is_success(false);
|
||||
out_result.set_error_text("CTI Code is not set");
|
||||
return rv;
|
||||
}
|
||||
rv.set_session(conn_ptr->name());
|
||||
rv.set_operator_id(ice_user_data->operator_id());
|
||||
rv.set_location(ice_user_data->location());
|
||||
rv.set_account(ice_account_data->clearing_account());
|
||||
rv.set_cti_code(ice_account_data->cti());
|
||||
rv.set_customer_or_firm(ice_account_data->origin());
|
||||
rv.set_order_server_id(ice_user_data->order_server_id());
|
||||
rv.set_trader_id(ice_user_data->authorized_trader());
|
||||
return rv;
|
||||
}
|
||||
case bts::api::Venue::VENUE_GLBX: {
|
||||
const bts::api::admin::CMEUserData* cme_user_data = get_user_cme_data(*user_ptr, data);
|
||||
if(cme_user_data==nullptr){
|
||||
@@ -434,7 +531,9 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(const bt
|
||||
rv.set_customer_or_firm(cme_account_data->origin());
|
||||
return rv;
|
||||
}
|
||||
case api::Venue::VENUE_SIM: {
|
||||
case api::Venue::VENUE_SIM:
|
||||
case api::Venue::VENUE_SIMICE:
|
||||
{
|
||||
const bts::api::admin::SIMUserData* sim_user_data = get_user_sim_data(*user_ptr, data);
|
||||
if(sim_user_data==nullptr){
|
||||
out_result.set_is_success(false);
|
||||
@@ -480,8 +579,7 @@ bts::api::orderman::RoutingRecord AdminServiceUtils::get_routing_record(const bt
|
||||
case api::Venue::VENUE_UNSET:
|
||||
case api::Venue::VENUE_BTS:
|
||||
case api::Venue::VENUE_CBOE:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::VENUE_ICE:
|
||||
case api::Venue::VENUE_CBOECFE:
|
||||
case api::Venue::Venue_INT_MIN_SENTINEL_DO_NOT_USE_:
|
||||
case api::Venue::Venue_INT_MAX_SENTINEL_DO_NOT_USE_:
|
||||
out_result.set_is_success(false);
|
||||
@@ -628,6 +726,18 @@ const bts::api::admin::CMEUserData* AdminServiceUtils::get_group_cme_data(const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::ICEUserData* AdminServiceUtils::get_group_ice_data(const bts::api::admin::BTSUserGroup& group,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (group.has_user_data() && group.user_data().has_exchange_user_data() && group.user_data().exchange_user_data().has_ice_data())
|
||||
return &(group.user_data().exchange_user_data().ice_data());
|
||||
else if (has_id(group.parent_group_id())){
|
||||
const bts::api::admin::BTSUserGroup* parent_group = find_group(data, group.parent_group_id());
|
||||
if (parent_group != nullptr)
|
||||
return get_group_ice_data(*parent_group, data);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::SIMUserData* AdminServiceUtils::get_group_sim_data(const bts::api::admin::BTSUserGroup& group,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (group.has_user_data() && group.user_data().has_exchange_user_data() && group.user_data().exchange_user_data().has_sim_data())
|
||||
@@ -758,6 +868,18 @@ const bts::api::admin::CMEUserData* AdminServiceUtils::get_user_cme_data(const b
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::ICEUserData* AdminServiceUtils::get_user_ice_data(const bts::api::admin::BTSUser& user,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (user.has_user_data() && user.user_data().has_exchange_user_data() && user.user_data().exchange_user_data().has_ice_data())
|
||||
return &(user.user_data().exchange_user_data().ice_data());
|
||||
else{
|
||||
const bts::api::admin::BTSUserGroup* parent_group = find_group(data, user.parent_group_id());
|
||||
if (parent_group != nullptr)
|
||||
return get_group_ice_data(*parent_group, data);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const bts::api::admin::SIMUserData* AdminServiceUtils::get_user_sim_data(const bts::api::admin::BTSUser& user,
|
||||
const bts::api::admin::AdminData& data){
|
||||
if (user.has_user_data() && user.user_data().has_exchange_user_data() && user.user_data().exchange_user_data().has_sim_data())
|
||||
@@ -785,7 +907,9 @@ std::string AdminServiceUtils::find_user_exchange_id (const bts::api::admin::Adm
|
||||
rv = cme_user_data->operator_id();
|
||||
break;
|
||||
}
|
||||
case api::Venue::VENUE_SIM: {
|
||||
case api::Venue::VENUE_SIM:
|
||||
case api::Venue::VENUE_SIMICE:
|
||||
{
|
||||
auto sim_user_data = get_user_sim_data(user, data);
|
||||
if (sim_user_data != nullptr)
|
||||
rv = sim_user_data->operator_id();
|
||||
@@ -1040,13 +1164,6 @@ void AdminServiceUtils::set_user_exchange_data(bts::api::admin::BTSUser* user,
|
||||
if (!user->user_data().has_exchange_user_data())
|
||||
user->mutable_user_data()->mutable_exchange_user_data()->CopyFrom(exchange_user_data);
|
||||
}
|
||||
void AdminServiceUtils::set_user_md_entitlement_data(bts::api::admin::BTSUser* user,
|
||||
const bts::api::admin::ExchangeUserMarketDataEntitlementData& exchange_user_md_entitelemnt_data){
|
||||
if (!user->has_user_data())
|
||||
user->mutable_user_data();
|
||||
if (!user->user_data().has_exchange_md_entitlement_data())
|
||||
user->mutable_user_data()->mutable_exchange_md_entitlement_data()->CopyFrom(exchange_user_md_entitelemnt_data);
|
||||
}
|
||||
void AdminServiceUtils::clear_user_accounts (bts::api::admin::BTSUser* user){
|
||||
if(user->has_user_data() && user->user_data().has_account_permissions())
|
||||
user->mutable_user_data()->clear_account_permissions();
|
||||
|
||||
@@ -35,6 +35,10 @@ public:
|
||||
const AdminData& data,
|
||||
const BTSAccount& account,
|
||||
const api::Security& sec);
|
||||
static const ExchangeConnection* resolve_ice_connection(
|
||||
const AdminData& data,
|
||||
const BTSAccount& account,
|
||||
const api::Security& sec);
|
||||
static const ExchangeConnection* resolve_sim_connection(
|
||||
const AdminData& data,
|
||||
const BTSAccount& account,
|
||||
@@ -85,6 +89,8 @@ public:
|
||||
// if needed)
|
||||
static const CMEAccountData* get_account_cme_data(const BTSAccount& account,
|
||||
const AdminData& data);
|
||||
static const ICEAccountData* get_account_ice_data(const BTSAccount& account,
|
||||
const AdminData& data);
|
||||
static const SIMAccountData* get_account_sim_data(const BTSAccount& account,
|
||||
const AdminData& data);
|
||||
// returns true if an account has a connection
|
||||
@@ -156,6 +162,8 @@ public:
|
||||
// travels up the group tree until it finds a populated cme data
|
||||
static const CMEUserData* get_group_cme_data(const BTSUserGroup& group,
|
||||
const AdminData& data);
|
||||
static const ICEUserData* get_group_ice_data(const BTSUserGroup& group,
|
||||
const AdminData& data);
|
||||
static const SIMUserData* get_group_sim_data(const BTSUserGroup& group,
|
||||
const AdminData& data);
|
||||
static const UserAccountPermissions* const get_group_user_permissions (
|
||||
@@ -190,6 +198,8 @@ public:
|
||||
static uint32_t find_max_user_id (const AdminData& data);
|
||||
static const CMEUserData* get_user_cme_data(const BTSUser& user,
|
||||
const AdminData& data);
|
||||
static const ICEUserData* get_user_ice_data(const BTSUser& user,
|
||||
const AdminData& data);
|
||||
static const SIMUserData* get_user_sim_data(const BTSUser& user,
|
||||
const AdminData& data);
|
||||
// finds the "exchange user" (ex: "operator_id" at CME or "authorized_trader"
|
||||
@@ -264,8 +274,6 @@ public:
|
||||
static void set_user_exchange_data(
|
||||
BTSUser* user,
|
||||
const ExchangeUserData& exchange_user_data);
|
||||
static void set_user_md_entitlement_data(BTSUser* user,
|
||||
const ExchangeUserMarketDataEntitlementData&);
|
||||
static void clear_user_accounts (BTSUser* user);
|
||||
static void set_user_accounts (BTSUser* user,
|
||||
const UserAccountPermissions& user_account_permissions);
|
||||
|
||||
@@ -76,7 +76,8 @@ message BTSUserDerivableData{
|
||||
// b. else its overridden at the user level
|
||||
UserAccountPermissions account_permissions = 70;
|
||||
ExchangeUserData exchange_user_data = 80;
|
||||
ExchangeUserMarketDataEntitlementData exchange_md_entitlement_data = 90;
|
||||
//ExchangeUserMarketDataEntitlementData exchange_md_entitlement_data = 90;
|
||||
reserved 90; reserved "exchange_md_entitlement_data";
|
||||
}
|
||||
|
||||
message LicenseData{
|
||||
@@ -201,19 +202,18 @@ message CMEMicData{
|
||||
}
|
||||
|
||||
message ICEMicData{
|
||||
api.CMEMics mic=10;
|
||||
api.ICEMics mic=10;
|
||||
bool enabled=20;
|
||||
}
|
||||
|
||||
message ExchangeUserMarketDataEntitlementData{
|
||||
CMEUserMarketDataEntitlementData cme_data = 10;
|
||||
ICEUserMarketDataEntitlementData ice_data = 20;
|
||||
}
|
||||
|
||||
message ExchangeUserData{
|
||||
CMEUserData cme_data = 10;
|
||||
ICEUserData ice_data = 20;
|
||||
SIMUserData sim_data = 30;
|
||||
|
||||
enum AdminDisplay { All = 0; MD = 1; Routing = 2; None = 100; }
|
||||
AdminDisplay admin_display_flag = 120;
|
||||
}
|
||||
|
||||
message ExchangeAccountData{
|
||||
@@ -222,9 +222,6 @@ message ExchangeAccountData{
|
||||
SIMAccountData sim_account_data = 30;
|
||||
}
|
||||
|
||||
message MarketDataEntitlement{
|
||||
bool can_view = 10;
|
||||
}
|
||||
|
||||
message ExchangeConnection{
|
||||
uint32 id = 10;
|
||||
@@ -314,8 +311,9 @@ message CMEUserData{
|
||||
ProfessionalDesignation pro_nonpro = 100;
|
||||
DisplayDesignation display_nondisplay = 110;
|
||||
|
||||
enum AdminDisplay { All = 0; MD = 1; Routing = 2; None = 100; }
|
||||
AdminDisplay admin_display_flag = 120;
|
||||
//enum AdminDisplay { All = 0; MD = 1; Routing = 2; None = 100; }
|
||||
//AdminDisplay admin_display_flag = 120;
|
||||
reserved 120; reserved "admin_display_flag";
|
||||
repeated CMEMicData md_permissions = 1000;
|
||||
}
|
||||
|
||||
@@ -324,15 +322,6 @@ message SIMUserData {
|
||||
string location = 90;
|
||||
}
|
||||
|
||||
message CMEUserMarketDataEntitlementData{
|
||||
MarketDataEntitlement cbot_entitlement = 10;
|
||||
MarketDataEntitlement cme_entitlement = 20;
|
||||
MarketDataEntitlement nymex_entitlement = 30;
|
||||
MarketDataEntitlement bmandf_entitlement = 40;
|
||||
MarketDataEntitlement comex_entitlement = 50;
|
||||
MarketDataEntitlement cme_europe_entitlement = 60;
|
||||
}
|
||||
|
||||
/********************************ICE Data*********************************/
|
||||
|
||||
message ICEConnection{
|
||||
@@ -349,9 +338,14 @@ message ICEConnection{
|
||||
}
|
||||
|
||||
message ICEAccountData{
|
||||
api.orderman.CTICode cti = 3;
|
||||
api.orderman.CustomerOrFirm origin = 5;
|
||||
|
||||
string nybit_house = 10;
|
||||
int32 wce_house = 20;
|
||||
string clearing_account_override = 30;
|
||||
//string clearing_account_override = 30;
|
||||
reserved 30; reserved "clearing_account_override";
|
||||
string clearing_account = 35;
|
||||
bool direct_electronic_access = 40;
|
||||
string trading_capacity = 50;
|
||||
bool liquidity_provision = 60;
|
||||
@@ -360,16 +354,24 @@ message ICEAccountData{
|
||||
string execution_decision_id = 90;
|
||||
string client_id = 100;
|
||||
string mfid_id = 110;
|
||||
|
||||
map<string, string> misc_tags = 120;
|
||||
}
|
||||
|
||||
message ICEUserData{
|
||||
string authorized_trader = 10;
|
||||
string order_server_id = 3; //tag 553 initial logon
|
||||
string operator_id = 5; //tag 50
|
||||
string authorized_trader = 10; //tag 553 trader logon
|
||||
string memo_field = 20;
|
||||
string text_b = 30;
|
||||
uint32 max_order_rate = 40;
|
||||
}
|
||||
|
||||
message ICEUserMarketDataEntitlementData{
|
||||
|
||||
map<string, string> misc_tags = 60;
|
||||
string location = 90;
|
||||
ProfessionalDesignation pro_nonpro = 100;
|
||||
DisplayDesignation display_nondisplay = 110;
|
||||
|
||||
repeated ICEMicData md_permissions = 1000;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
@@ -260,6 +260,9 @@ message RoutingRecord {
|
||||
string smp_id = 6 ;
|
||||
SelfMatchPreventionInstruction smp_instruction = 7;
|
||||
string location = 8;
|
||||
|
||||
string order_server_id = 30;
|
||||
string trader_id = 31;
|
||||
}
|
||||
|
||||
message NativeOrderState {
|
||||
|
||||
@@ -3,7 +3,8 @@ Ports {
|
||||
value {
|
||||
config_port: 8000
|
||||
qbus_port: 8001
|
||||
exchange_sim_fix_port: 8002
|
||||
glbx_sim_fix_port: 8002
|
||||
ice_sim_fix_port: 8003
|
||||
replicator_port: 8080
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ JetFIXSimConnection {
|
||||
name: "sim"
|
||||
platform: SIM
|
||||
socket_connect_host_ip: "127.0.0.1"
|
||||
socket_connect_port: @Ports.exchange_sim_fix_port
|
||||
socket_connect_port: @Ports.glbx_sim_fix_port
|
||||
sender_compid: "SPARK" # this is the FIX session name
|
||||
sender_subid: "BTS"
|
||||
target_compid: "BTS"
|
||||
@@ -17,10 +17,47 @@ JetFIXSimConnection {
|
||||
use_cme_secure_logon: false
|
||||
seconds_to_pause : 1
|
||||
}
|
||||
sim_ice {
|
||||
name: "sim_ice"
|
||||
platform: SIMICE
|
||||
socket_connect_host_ip: "127.0.0.1"
|
||||
socket_connect_port: @Ports.ice_sim_fix_port
|
||||
sender_compid: "SPARK" # this is the FIX session name
|
||||
sender_subid: "BTS"
|
||||
target_compid: "BTS"
|
||||
target_subid: "BTS"
|
||||
cme_market_segment_id: 0
|
||||
end_time: "07:48:00"
|
||||
start_time: "07:52:00"
|
||||
raw_data: "1JE9X"
|
||||
use_cme_secure_logon: false
|
||||
seconds_to_pause : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JetFIX {
|
||||
rule: "CannedCertSession.name='ice_cert'"
|
||||
value {
|
||||
connection: @JetFIXSimConnection.sim
|
||||
connection {
|
||||
name: "ice_cert"
|
||||
platform: ICE
|
||||
use_cme_secure_logon: false
|
||||
|
||||
socket_connect_host_ip: "63.247.113.154"
|
||||
socket_connect_port: 443 #80
|
||||
sender_compid: "51239"
|
||||
target_compid: "ICE"
|
||||
|
||||
start_time: "00:30:00"
|
||||
end_time: "23:30:00"
|
||||
sender_subid: "BTS"
|
||||
user_id: "bluetrd-os"
|
||||
raw_data: "Starts123"
|
||||
auto_fix_seq_num: true
|
||||
}
|
||||
}
|
||||
rule: "CannedCertSession.name='mc7'"
|
||||
value {
|
||||
connection: @JetFIXSimConnection.sim
|
||||
|
||||
@@ -5,6 +5,7 @@ message Ports {
|
||||
// see ports.conf for actual defaults
|
||||
optional int32 config_port = 1 ;
|
||||
optional int32 qbus_port = 2 ;
|
||||
optional int32 exchange_sim_fix_port = 3 ;
|
||||
optional int32 glbx_sim_fix_port = 3 ;
|
||||
optional int32 ice_sim_fix_port = 5 ;
|
||||
optional int32 replicator_port = 4 ;
|
||||
}
|
||||
@@ -7,9 +7,11 @@ message JetFIX {
|
||||
required string name = 10;
|
||||
|
||||
enum JetFIXPlatform {
|
||||
GLBX = 1;
|
||||
CBOE = 6;
|
||||
SIM = 2;
|
||||
GLBX = 1;
|
||||
CBOE = 6;
|
||||
SIM = 2;
|
||||
ICE = 3;
|
||||
SIMICE = 4;
|
||||
}
|
||||
optional JetFIXPlatform platform = 15 [default = GLBX];
|
||||
|
||||
@@ -47,6 +49,7 @@ message JetFIX {
|
||||
optional string target_subid = 130 [default = ""];
|
||||
optional string sender_locationid = 135 [default = "US,NC"];
|
||||
optional string raw_data = 136 [default =""];
|
||||
optional string user_id = 138 [default =""];
|
||||
optional string self_match_prevention_id = 140 [default=""];
|
||||
optional string cti_code = 145 [default="1"];
|
||||
optional int32 customer_or_firm = 147 [default=1];
|
||||
@@ -91,6 +94,7 @@ message JetFIX {
|
||||
|
||||
message JetFIXSimConnection {
|
||||
required JetFIX.Connection sim = 10;
|
||||
required JetFIX.Connection sim_ice = 20;
|
||||
}
|
||||
|
||||
message CannedCertSession {
|
||||
|
||||
@@ -12,6 +12,7 @@ enum Venue {
|
||||
VENUE_CBOECFE = 207;
|
||||
VENUE_GLBX = 301;
|
||||
VENUE_ICE = 306;
|
||||
VENUE_SIMICE = 3;
|
||||
}
|
||||
|
||||
enum SecurityType {
|
||||
@@ -54,11 +55,12 @@ enum CMEMics {
|
||||
}
|
||||
|
||||
enum ICEMics{
|
||||
ICE_UNSET=0;
|
||||
ICE_US = 1;
|
||||
ICE_EU = 2;
|
||||
ICE_LIFFE = 3;
|
||||
ICE_CA = 4;
|
||||
IF_UNSET = 0;
|
||||
IFUS = 1;
|
||||
IFEU = 2;
|
||||
IFLL = 3;
|
||||
IFCA = 4;
|
||||
IFEN = 5;
|
||||
}
|
||||
|
||||
enum Side {
|
||||
|
||||
@@ -97,6 +97,7 @@ typedef StringField<7928> SelfMatchPreventionID;
|
||||
typedef StringField<8> BeginString;
|
||||
typedef StringField<9324> OrderOptionalData;
|
||||
typedef StringField<96> RawData;
|
||||
typedef StringField<553> UserID;
|
||||
typedef StringField<9717> CorrelationClOrdID;
|
||||
typedef StringField<9771> MMAccount;
|
||||
typedef TimeField<122> OrigSendingTime;
|
||||
|
||||
@@ -819,6 +819,8 @@ OutFIXPtr make_logon(uint32_t seq_num, uint32_t last_seq_num_processed,
|
||||
} else {
|
||||
buffer.add<RawDataLength>(session_cfg.raw_data().size());
|
||||
buffer.add<RawData>(session_cfg.raw_data());
|
||||
if(session_cfg.user_id() != "")
|
||||
buffer.add<UserID>(session_cfg.user_id());
|
||||
}
|
||||
|
||||
stream.close();
|
||||
|
||||
@@ -50,6 +50,8 @@ ExecutionGateway::ExecutionGateway(config::JetFIX::Connection const &cfg,
|
||||
}
|
||||
ExecutionGateway::~ExecutionGateway() {}
|
||||
|
||||
void ExecutionGateway::on_admin_data(const mercury::Update<NewAdminDataEvent> &) {}
|
||||
|
||||
void ExecutionGateway::on_securities(
|
||||
const mercury::Update<NewSecuritiesEvent> &update) {
|
||||
if (update.events) {
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace bts {
|
||||
namespace trace {struct CorID;class PerfLog;}
|
||||
namespace orderman {
|
||||
class NewSecuritiesEvent;
|
||||
class NewAdminDataEvent;
|
||||
class ExecutionReport;
|
||||
|
||||
using OnExeReport =
|
||||
@@ -28,6 +29,7 @@ class ExecutionGateway {
|
||||
void start();
|
||||
void dispatch_incoming_fix_messages();
|
||||
void on_securities(const mercury::Update<NewSecuritiesEvent> &);
|
||||
void on_admin_data(const mercury::Update<NewAdminDataEvent> &);
|
||||
void send_fix(jetfix::OutFIXPtr const &fix, trace::CorID trace);
|
||||
|
||||
OnExeReport& on_exe_report();
|
||||
|
||||
@@ -53,14 +53,17 @@ void OrderManager::init() {
|
||||
}
|
||||
|
||||
void OrderManager::on_admin_data(const mercury::Update<NewAdminDataEvent> &m) {
|
||||
if (m.events) {
|
||||
|
||||
if (me->state == State::WAIT_ADMIN) {
|
||||
LOG(OrderMan, Info,
|
||||
"Order manager received admin data. Subscribing "
|
||||
"to security list now ");
|
||||
if (m.events)
|
||||
{
|
||||
if (me->state == State::WAIT_ADMIN)
|
||||
{
|
||||
LOG(OrderMan, Info, "Order manager received admin data. Subscribing to security list now ");
|
||||
for (auto &osd : me->services_data.sessions)
|
||||
osd->gw.on_admin_data(m);
|
||||
|
||||
me->state = State::WAIT_SEC;
|
||||
subscribe<NewSecuritiesEvent>([this](auto const &sec_update) {
|
||||
subscribe<NewSecuritiesEvent>([this](auto const &sec_update)
|
||||
{
|
||||
this->on_securities(sec_update);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace cmd {
|
||||
|
||||
int RunSim::execute(std::vector<std::string> const &)
|
||||
{
|
||||
sim::start_exchange_sim();
|
||||
sim::start_exchange_sim(api::Venue::VENUE_SIM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <fstream>
|
||||
|
||||
#include "lib/os/os.h"
|
||||
#include "lib/domain_model/Security.pb.h"
|
||||
#include "lib/config/protos/Ports.pb.h"
|
||||
#include "lib/config/protos/ExchangeSimCfg.pb.h"
|
||||
#include "lib/config/config.h"
|
||||
@@ -121,15 +122,26 @@ struct MDPlayer : md::IRelayWriter
|
||||
};
|
||||
|
||||
|
||||
int start_exchange_sim()
|
||||
int start_exchange_sim(bts::api::Venue venue)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto str_settings = std::string(cfg);
|
||||
boost::replace_all(str_settings,"$BTS_DATA_PATH", os::bts_data_path());
|
||||
boost::replace_all(str_settings,"$EXCHANGE_SIM_FIX_PORT",
|
||||
std::to_string(
|
||||
config::get<config::Ports>().exchange_sim_fix_port()));
|
||||
auto venue_string = api::Venue_Name(venue);
|
||||
boost::replace_all(str_settings,"$BTS_DATA_PATH", os::bts_data_path() + "_" + venue_string);
|
||||
std::string port_string;
|
||||
switch(venue)
|
||||
{
|
||||
case api::VENUE_SIM:
|
||||
port_string = std::to_string(config::get<config::Ports>().glbx_sim_fix_port());
|
||||
break;
|
||||
case api::VENUE_SIMICE:
|
||||
port_string = std::to_string(config::get<config::Ports>().ice_sim_fix_port());
|
||||
break;
|
||||
default:
|
||||
bts_assert_msg(false, "Not a valid sim venue");
|
||||
}
|
||||
boost::replace_all(str_settings,"$EXCHANGE_SIM_FIX_PORT", port_string);
|
||||
|
||||
std::istringstream str{str_settings};
|
||||
FIX::SessionSettings settings( str );
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "lib/domain_model/Security.pb.h"
|
||||
|
||||
namespace bts {
|
||||
namespace sim {
|
||||
|
||||
int start_exchange_sim();
|
||||
int start_exchange_sim(bts::api::Venue);
|
||||
|
||||
}}
|
||||
@@ -152,8 +152,8 @@ void run_market_datapublishers() {
|
||||
});
|
||||
|
||||
if (config::get<MarketDataConfig>().use_sim()) {
|
||||
threading::make_thread("ExchangeSim", []() { sim::start_exchange_sim(); })
|
||||
.detach();
|
||||
threading::make_thread("ExchangeSimGLBX", []() { sim::start_exchange_sim(api::Venue::VENUE_SIM); }).detach();
|
||||
threading::make_thread("ExchangeSimICE", []() { sim::start_exchange_sim(api::Venue::VENUE_SIMICE); }).detach();
|
||||
}
|
||||
boot_sleep();
|
||||
}
|
||||
|
||||
@@ -190,10 +190,10 @@ void AdminServiceServer::get_filtered_admin_data(
|
||||
newuser->CopyFrom(*acctuser);
|
||||
if(!unit.admin_permission().has_md_permissions())
|
||||
newuser->mutable_user_data()->mutable_exchange_user_data()->
|
||||
mutable_cme_data()->set_admin_display_flag(bts::api::admin::CMEUserData_AdminDisplay::CMEUserData_AdminDisplay_Routing);
|
||||
set_admin_display_flag(bts::api::admin::ExchangeUserData_AdminDisplay::ExchangeUserData_AdminDisplay_Routing);
|
||||
else
|
||||
newuser->mutable_user_data()->mutable_exchange_user_data()->
|
||||
mutable_cme_data()->set_admin_display_flag(bts::api::admin::CMEUserData_AdminDisplay::CMEUserData_AdminDisplay_All);
|
||||
set_admin_display_flag(bts::api::admin::ExchangeUserData_AdminDisplay::ExchangeUserData_AdminDisplay_All);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +208,7 @@ void AdminServiceServer::get_filtered_admin_data(
|
||||
const auto newuser = filtered.add_users();
|
||||
newuser->CopyFrom(*acctuser);
|
||||
newuser->mutable_user_data()->mutable_exchange_user_data()->
|
||||
mutable_cme_data()->set_admin_display_flag(bts::api::admin::CMEUserData_AdminDisplay::CMEUserData_AdminDisplay_MD);
|
||||
set_admin_display_flag(bts::api::admin::ExchangeUserData_AdminDisplay::ExchangeUserData_AdminDisplay_MD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,9 +86,12 @@ module Accounts =
|
||||
miscTags = JSMap.empty<string>
|
||||
}
|
||||
iceAccountData =
|
||||
{ nybitHouse=""
|
||||
{
|
||||
cti = CTICode.CtiCodeUndefined
|
||||
origin = CustomerOrFirm.CustomerOrFirmCustomer
|
||||
nybitHouse=""
|
||||
wceHouse=0
|
||||
clearingAccountOverride=""
|
||||
clearingAccount=""
|
||||
directElectronicAccess=false
|
||||
tradingCapacity=""
|
||||
liquidityProvision=false
|
||||
@@ -96,7 +99,9 @@ module Accounts =
|
||||
investmentDecisionId=""
|
||||
executionDecisionId=""
|
||||
clientId=""
|
||||
mfidId="" }
|
||||
mfidId=""
|
||||
miscTags = JSMap.empty<string>
|
||||
}
|
||||
simAccountData =
|
||||
{ cti = CTICode.CtiCodeUndefined
|
||||
origin = CustomerOrFirm.CustomerOrFirmCustomer
|
||||
|
||||
@@ -53,8 +53,8 @@ let defaultScratchUser = {
|
||||
accountPermissions = { accountPermissions = JSMap.empty<UserAccountPermissionUnit> }
|
||||
exchangeUserData =
|
||||
{
|
||||
cmeData = {
|
||||
adminDisplayFlag = bts.api.admin.CMEUserData.AdminDisplay.None
|
||||
adminDisplayFlag = bts.api.admin.ExchangeUserData.AdminDisplay.None
|
||||
cmeData = {
|
||||
operatorId = ""
|
||||
atsOperatorId = ""
|
||||
smpId = ""
|
||||
@@ -73,25 +73,19 @@ let defaultScratchUser = {
|
||||
location = ""
|
||||
}
|
||||
iceData = {
|
||||
orderServerId = ""
|
||||
operatorId = ""
|
||||
authorizedTrader = ""
|
||||
memoField = ""
|
||||
textB = ""
|
||||
maxOrderRate = 0ul
|
||||
miscTags = JSMap.empty<string>
|
||||
location = ""
|
||||
proNonpro = ProfessionalDesignation.PRO
|
||||
displayNondisplay = DisplayDesignation.DISPLAY
|
||||
mdPermissions = [||]
|
||||
}
|
||||
}
|
||||
exchangeMdEntitlementData =
|
||||
{
|
||||
cmeData =
|
||||
{
|
||||
cbotEntitlement = { canView = false }
|
||||
cmeEntitlement = { canView = false }
|
||||
nymexEntitlement = { canView = false }
|
||||
bmandfEntitlement = { canView = false }
|
||||
comexEntitlement = { canView = false }
|
||||
cmeEuropeEntitlement = { canView = false }
|
||||
}
|
||||
iceData = ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,9 +176,10 @@ let createUser (admin:IAdminService) (user:BTSUser) (model:Model)= promise {
|
||||
return ErrorOccured (sprintf "Error creating user: %s" result.errorText)
|
||||
}
|
||||
|
||||
let updateExchangeMdEntitlementDataCMEData user dta :BTSUser = { user with userData = { user.userData with exchangeMdEntitlementData = { user.userData.exchangeMdEntitlementData with cmeData = dta}}}
|
||||
//let updateExchangeMdEntitlementDataCMEData user dta :BTSUser = { user with userData = { user.userData with exchangeMdEntitlementData = { user.userData.exchangeMdEntitlementData with cmeData = dta}}}
|
||||
let updateCMEExchangeUserData (user:BTSUser) dta = { user with userData = { user.userData with exchangeUserData = { user.userData.exchangeUserData with cmeData = dta }}}
|
||||
let updateSIMExchangeUserData (user:BTSUser) dta = { user with userData = { user.userData with exchangeUserData = { user.userData.exchangeUserData with simData = dta }}}
|
||||
let updateICEExchangeUserData (user:BTSUser) dta = { user with userData = { user.userData with exchangeUserData = { user.userData.exchangeUserData with iceData = dta }}}
|
||||
|
||||
let default_user_account = {
|
||||
tradingPermission =
|
||||
|
||||
@@ -435,10 +435,10 @@ let root (model:Model) (dispatch:Msg->Unit) =
|
||||
| _, _ -> ()
|
||||
)
|
||||
*)
|
||||
let adminDisplay = model.scratchUser.userData.exchangeUserData.cmeData.adminDisplayFlag
|
||||
let adminDisplay = model.scratchUser.userData.exchangeUserData.adminDisplayFlag
|
||||
let is_bts = model.this_username = Access.superuser
|
||||
let display_md = if is_bts then true else (adminDisplay = bts.api.admin.CMEUserData.AdminDisplay.All || adminDisplay = bts.api.admin.CMEUserData.AdminDisplay.MD)
|
||||
let display_risk = if is_bts then true else (adminDisplay = bts.api.admin.CMEUserData.AdminDisplay.All || adminDisplay = bts.api.admin.CMEUserData.AdminDisplay.Routing)
|
||||
let display_md = if is_bts then true else (adminDisplay = bts.api.admin.ExchangeUserData.AdminDisplay.All || adminDisplay = bts.api.admin.ExchangeUserData.AdminDisplay.MD)
|
||||
let display_risk = if is_bts then true else (adminDisplay = bts.api.admin.ExchangeUserData.AdminDisplay.All || adminDisplay = bts.api.admin.ExchangeUserData.AdminDisplay.Routing)
|
||||
|
||||
let modal = match (fst model.ConfirmModal) with
|
||||
| "" -> span [] []
|
||||
|
||||
Reference in new issue
Block a user