Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ee94a53e3 | ||
|
|
ca7769efe3 | ||
|
|
f5d0468e41 | ||
|
|
9a5f377465 | ||
|
|
9c4f33e4b7 |
No files matched your search
+2
-2
@@ -25,7 +25,7 @@ if (WIN32)
|
||||
set(BUILD_ADMIN_WEB_APP OFF CACHE BOOL "Build the Admin WebApp")
|
||||
else()
|
||||
set(BUILD_SPARKD ON CACHE BOOL "Build sparkd")
|
||||
set(BUILD_ADMIN_WEB_APP ON CACHE BOOL "Build the Admin WebApp")
|
||||
# set(BUILD_ADMIN_WEB_APP ON CACHE BOOL "Build the Admin WebApp")
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE SYSTEM ${SPARK_INCLUDE} ${EXTERNALS_ROOT}/include/zlib)
|
||||
@@ -117,7 +117,7 @@ else()
|
||||
endif()
|
||||
add_subdirectory(src/lib)
|
||||
if (BUILD_ADMIN_WEB_APP)
|
||||
add_subdirectory(src/Spark.Admin.WebApp)
|
||||
# add_subdirectory(src/Spark.Admin.WebApp)
|
||||
endif()
|
||||
if(BUILD_DOCS)
|
||||
add_subdirectory(doc/user)
|
||||
|
||||
@@ -267,7 +267,6 @@
|
||||
"hidden": true,
|
||||
"targets": [
|
||||
"data_files_dir",
|
||||
"admin_web_app_bundle",
|
||||
"install",
|
||||
"libspark",
|
||||
"rapidjson_project",
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "lib/api/domain/SecurityCriteria.proto";
|
||||
|
||||
package bts.api.md;
|
||||
|
||||
option csharp_namespace = "bts.api.md";
|
||||
|
||||
|
||||
message GlbxMarketDataConfig {
|
||||
uint32 unique_check_value = 1;
|
||||
//uint32 num_depth_levels = 1;
|
||||
//uint32 depth_throttle_ms = 2;
|
||||
bts.api.domain.SecurityCriteria security_criteria = 3;
|
||||
// Market data isn't subscribed for securities listed here (even if they are
|
||||
// included by 'security_criteria'). There are some securities that don't
|
||||
// fit into our system just yet, such as 'BTCBIDR', which trades in prices
|
||||
// larger than our cpp 'domain::Price' class supports.
|
||||
//repeated string excluded_securities = 4;
|
||||
//string url_rest_base = 5;
|
||||
//string url_ws_base = 6;
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import "lib/api/md/MarketDataReplayConfig.proto";
|
||||
import "lib/api/md/DeribitMarketDataConfig.proto";
|
||||
import "lib/api/md/EmumbaDeribitMarketDataConfig.proto";
|
||||
import "lib/api/md/OkxMarketDataConfig.proto";
|
||||
|
||||
import "lib/api/md/GlbxMarketDataConfig.proto";
|
||||
|
||||
option csharp_namespace = "bts.api.md";
|
||||
|
||||
@@ -24,6 +24,7 @@ message MarketDataConfig {
|
||||
repeated DeribitMarketDataConfig deribit = 5;
|
||||
repeated CoinbaseMarketDataConfig coinbase =6;
|
||||
repeated OkxMarketDataConfig okx = 7;
|
||||
repeated GlbxMarketDataConfig glbx = 8;
|
||||
// Add an entry here for all the exchanges that need their market data to be recorded
|
||||
|
||||
repeated EmumbaDeribitMarketDataConfig emumba_deribit = 100;
|
||||
|
||||
@@ -19,6 +19,8 @@ std::set<bts::api::Venue> MarketDataConfigUtils::get_live_exchanges(
|
||||
rv.insert(bts::api::VENUE_BINANCE_US);
|
||||
if (cfg.deribit_size() > 0)
|
||||
rv.insert(bts::api::VENUE_DERIBIT);
|
||||
if (cfg.glbx_size()>0)
|
||||
rv.insert(bts::api::VENUE_GLBX);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ void ConfigurationState::initialize_builtins(ConfigLog *log) {
|
||||
sys.set_platform(os::platform_name());
|
||||
sys.set_unittest_environment(utils::internal::is_unittest_environment());
|
||||
sys.set_config_path(os::app_data_path("conf/").string());
|
||||
sys.set_data_path(os::app_data_path("data/").string());
|
||||
sys.set_data_path(os::app_data_path("data/").string());//look at this
|
||||
sys.set_os_user(os::username());
|
||||
#ifndef NDEBUG
|
||||
sys.set_build_type("debug");
|
||||
|
||||
@@ -9,7 +9,7 @@ HistoricMarketDataConfig {
|
||||
|
||||
PlatformMap {
|
||||
value {
|
||||
glbx_platform: "PLATFORM_SIM"
|
||||
glbx_platform: "PLATFORM_MDP3ONIXS"
|
||||
ice_platform: "PLATFORM_ICEONIXS"
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ PublisherOptions {
|
||||
hot_growth: 1024
|
||||
cold_initial: 8192
|
||||
cold_growth: 2048
|
||||
channel_prefix: ""
|
||||
disable_heartbeat: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,11 +99,18 @@ CMEOptions {
|
||||
feed_engine {
|
||||
name: "mdp3feed"
|
||||
spin_time: 0
|
||||
channels_per_thread: 3
|
||||
data_wait: 10
|
||||
upp_socket_buffer_size: 268435456
|
||||
}
|
||||
channel {
|
||||
id: "*"
|
||||
feed_engine: "mdp3feed"
|
||||
use_tcp_replay: false
|
||||
recovery_queue_size: 640000
|
||||
lost_packet_wait_timeout_ms: 10
|
||||
use_natural_refresh: false
|
||||
join_snapshot_on_gap: false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,3 +231,10 @@ MarketDataConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OnixsOptions {
|
||||
value{
|
||||
onixs_license: "{default}"
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,11 @@ OrdersSoftCleanup {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
|
||||
PlacementInQueue {
|
||||
vlaue{
|
||||
enabled: true;
|
||||
}
|
||||
}
|
||||
RiskLimit {
|
||||
value{
|
||||
risk_limits{
|
||||
|
||||
@@ -140,7 +140,9 @@ MDProducer::MDProducer(
|
||||
: _mutex(new std::mutex()), _producers(),
|
||||
_id_recorder(std::make_unique<SecurityIDRecorder>(recorder)),
|
||||
_platform(platform), _flags(flags),
|
||||
_smapper(flags & MDProducerFlags::SecurityMapper) {}
|
||||
_smapper(flags & MDProducerFlags::SecurityMapper) {
|
||||
//LOG(md, Info, "MDProducer::MDProducer Constructor done");
|
||||
}
|
||||
#endif
|
||||
MDProducer::MDProducer(MDProducer &&other)
|
||||
: _mutex(std::move(other._mutex)), _producers(std::move(other._producers)),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "server/sparkd/md/platforms/mdp3_onixs/MDP3Main.h"
|
||||
#if !defined(_WIN32) && defined(SPARK_ENABLE_CCAPI)
|
||||
#include "MarketDataGateway.h"
|
||||
#include "lib/api/md/EmumbaDeribitMarketDataConfig.pb.h"
|
||||
@@ -141,6 +142,10 @@ void MarketDataGateway::run() {
|
||||
bts_assert(me_->md_config.emumba_deribit().size() == 1);
|
||||
_start_emumba_deribit(me_->md_config.emumba_deribit().at(0));
|
||||
}
|
||||
if(!me_->md_config.glbx().empty()){
|
||||
bts_assert(me_->md_config.glbx().size() == 1);
|
||||
_start_onix_glbx(me_->md_config.glbx().at(0));
|
||||
}
|
||||
_start_replays(me_->md_config);
|
||||
while (true) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
@@ -236,6 +241,46 @@ void MarketDataGateway::unsubscribe(MarketDataListenerID id) {
|
||||
LOG(md, Info, "Unsubscribing listener {}", id);
|
||||
me_->listeners.erase(id);
|
||||
}
|
||||
/// glbx //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void run_onixs() {
|
||||
LOG(md, Info, "MarketDataGateway::run_onixs t_id:{} t_name", os::get_thread_id(),
|
||||
os::get_thread_name());
|
||||
bts::md::MBOWriter *mbo = nullptr;
|
||||
bts::md::TradeSummarySignalDispatcher *tssd = nullptr;
|
||||
std::vector<std::shared_ptr<bts::md::IMDPlatform>> platforms;
|
||||
// get all glbx symbols
|
||||
auto cme_symbols =
|
||||
SymbolLoader::load(bts::domain::SecurityCriteria::create({api::domain::VENUE_GLBX}));
|
||||
if (!cme_symbols.empty()) {
|
||||
auto *main = new bts::md::MDP3Main();
|
||||
main->start(
|
||||
{cme_symbols.begin(), cme_symbols.end()}, mbo, tssd);
|
||||
platforms.emplace_back(main);
|
||||
}
|
||||
// deribit
|
||||
// auto *d_platform = new bts::md::EmMDListener()
|
||||
// Timers
|
||||
auto &disp = utils::Dispatcher::current();
|
||||
utils::DispatcherTimer heartbeat_timer(disp, 250, [&]() {
|
||||
for (auto &p : platforms)
|
||||
p->send_heartbeats();
|
||||
});
|
||||
heartbeat_timer.start();
|
||||
|
||||
disp.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MarketDataGateway::_start_onix_glbx( bts::api::md::GlbxMarketDataConfig cfg){
|
||||
LOG(md, Info,
|
||||
"MarketDataGateway::_start_onix_glbx starting t_id:{} t_name:{}. "
|
||||
"cfg:\n{}",
|
||||
os::get_thread_id(), os::get_thread_name(), cfg.DebugString());
|
||||
bts::md::run_onixs();
|
||||
}
|
||||
|
||||
|
||||
// deribit ////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "lib/api/md/GlbxMarketDataConfig.pb.h"
|
||||
#if !defined(_WIN32) && defined(SPARK_ENABLE_CCAPI)
|
||||
#include "MarketDataListenerID.h"
|
||||
#include <memory>
|
||||
@@ -31,6 +32,8 @@ class MarketDataGateway {
|
||||
MarketDataRegistration _start_cc(const api::md::MarketDataConfig &) noexcept;
|
||||
static void _start_emumba_deribit(
|
||||
bts::api::md::EmumbaDeribitMarketDataConfig cfg);
|
||||
static void _start_onix_glbx(
|
||||
bts::api::md::GlbxMarketDataConfig cfg);
|
||||
void _start_replays(const bts::api::md::MarketDataConfig &cfg);
|
||||
};
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ SecurityIDRecorder::SecurityIDRecorder(SecurityIDRecorderParams params)
|
||||
if (params.dispatcher) {
|
||||
_self->run(*params.dispatcher);
|
||||
}
|
||||
// LOG(md, Info, "SecurityIDRecorder::Constructor done");
|
||||
}
|
||||
|
||||
SecurityIDRecorder::~SecurityIDRecorder() {}
|
||||
@@ -103,6 +104,7 @@ void SecurityIDRecorder::init() {
|
||||
sqlite::exec_nofail(
|
||||
_self->db, "CREATE TABLE IF NOT EXISTS security_keys (descriptor STRING "
|
||||
"NOT NULL PRIMARY KEY, type int);");
|
||||
LOG(md, Info, "SecurityIDRecorder::exit");
|
||||
}
|
||||
|
||||
void SecurityIDRecorder::ensure_key(MDProducerHandle handle) {
|
||||
|
||||
@@ -70,11 +70,17 @@ struct CppOverride : public ISecurityMapper {
|
||||
};
|
||||
|
||||
SecurityMapper::SecurityMapper(bool enabled) : _impl() {
|
||||
LOG(md, Info, "SecurityMapper::SecurityMapper Constructor start");
|
||||
if (enabled) {
|
||||
LOG(md, Info, "SecurityMapper::SecurityMapper Constructor 1");
|
||||
_impl.push_back(std::make_unique<DisplayFactorMapper>());
|
||||
LOG(md, Info, "SecurityMapper::SecurityMapper Constructor 2");
|
||||
_impl.push_back(std::make_unique<CppOverride>());
|
||||
LOG(md, Info, "SecurityMapper::SecurityMapper Constructor 3");
|
||||
// Register more mappers HERE
|
||||
}
|
||||
LOG(md, Info, "SecurityMapper::SecurityMapper Constructor end");
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -61,7 +61,7 @@ void await_cme_config() {
|
||||
std::lock_guard<std::mutex> guard(config_mutex);
|
||||
std::string config_url;
|
||||
std::string templates_url;
|
||||
|
||||
// LOG(md, Info, "MDP3Utils::await_cme_confi: data_path:{}", data_path());
|
||||
if (config::get<config::DeploymentType>().type() != "dev") {
|
||||
config_url =
|
||||
"ftp://ftp.cmegroup.com/SBEFix/Production/Configuration/config.xml";
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ OnixsTemplLicense onixs_create_temporary_license() {
|
||||
const auto &options = config::get<OnixsOptions>();
|
||||
OnixsTemplLicense linfo;
|
||||
linfo.path = options.onixs_license();
|
||||
if (linfo.path == "{default}") {
|
||||
if (linfo.path == "{default}" || linfo.path =="") {
|
||||
linfo.path = Path{config::get<SystemConfig>().data_path()} / "licenses";
|
||||
auto ident = boost::filesystem::unique_path("%%%%-%%%%-%%%%-%%%%.lic");
|
||||
linfo.license = {linfo.path / ident};
|
||||
|
||||
@@ -30,9 +30,10 @@ std::unique_ptr<IExecutionGateway> ExecutionGatewayFactory::create_gateway(
|
||||
conn.venue() == bts::api::VENUE_SIMICE)
|
||||
return std::make_unique<ICEExecutionGateway>(conn, pl, o);
|
||||
else if (conn.venue() == bts::api::VENUE_GLBX) {
|
||||
if (conn.use_ilink3())
|
||||
return std::make_unique<ilink3::GLBXiLink3ExecutionGateway>(
|
||||
conn, pl, o);
|
||||
//ADD ASSERT
|
||||
// if (conn.use_ilink3())
|
||||
// return std::make_unique<ilink3::GLBXiLink3ExecutionGateway>(
|
||||
// conn, pl, o);
|
||||
return std::make_unique<GLBXExecutionGateway>(conn, pl, o);
|
||||
} else if (conn.venue() == bts::api::VENUE_DERIBIT)
|
||||
// return std::make_unique<EMExecutionGateway>(o);
|
||||
|
||||
@@ -51,7 +51,7 @@ static void run_replay() {
|
||||
replay_opts.url(), config::get<bts::md::RelayOptions>().naggle_ms(),
|
||||
replay_opts.fallback());
|
||||
}
|
||||
|
||||
//THIS IS
|
||||
static void run_onixs(
|
||||
bts::md::MBOWriter *mbo_writer,
|
||||
bts::md::TradeSummarySignalDispatcher *tss_dispatcher) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
using namespace std;
|
||||
using namespace bts::co2;
|
||||
using std::size_t;
|
||||
|
||||
//THIS IS ALSO IMPORTANT
|
||||
namespace bts {
|
||||
namespace md {
|
||||
|
||||
@@ -37,7 +37,7 @@ MDP3Main::MDP3Main()
|
||||
}}),
|
||||
_producer(PLATFORM_MDP3ONIXS, _recorder),
|
||||
// _settlement_recorder(PLATFORM_MDP3ONIXS),
|
||||
_engines(), _handlers(), _listeners(), _recovery() {}
|
||||
_engines(), _handlers(), _listeners(), _recovery() {LOG(md, Info, "MDP3Main::MDP3Main::Constructor done");}
|
||||
|
||||
MDP3Main::~MDP3Main() {}
|
||||
|
||||
@@ -86,6 +86,7 @@ const onixs::FeedEngineSettings feed_engine_settings_from_config(
|
||||
if (settings.num_threads() != 0) {
|
||||
result.threadCount(settings.num_threads());
|
||||
} else {
|
||||
bts_assert(settings.channels_per_thread()>0);
|
||||
// If num_threads is absent determine thread count based on #channels
|
||||
result.threadCount((feed_count / settings.channels_per_thread()) + 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user