temporarily tie span enforcement to config while michael works

This commit is contained in:
Kevin Darby committed 2019-07-05 12:59:41 -04:00
1 parent b7e5c3a374
commit d871ffca6d
1 file changed
+7 -3
+7 -3
View File
@@ -10,6 +10,9 @@
#include "ProductLimitTree.h"
#include "SecurityLimitTree.h"
#include "lib/os/os.h"
#include "lib/config/config.h"
#include "lib/config/protos/span.pb.h"
namespace bts {
namespace orderman {
@@ -272,9 +275,10 @@ private:
const auto acct_it = _account_data_map.find(account_id.value());
if(acct_it != _account_data_map.end()){
const auto& account_data = acct_it->second;
const auto& account = account_data.account;
if (account.has_margin_limit() &&
account.margin_limit().enforce_margin()){
//const auto& account = account_data.account;
if(config::get<bts::config::SpanMargin>().enabled()) {
// if (account.has_margin_limit() &&
// account.margin_limit().enforce_margin()){
double ex_liq = account_data.excess_liquidity;
if(os::is_nan(ex_liq)){
out_res.result = Limiter::LimiterErrorCode::MARGIN_LIMIT_BREACHED;