temporarily tie span enforcement to config while michael works
This commit is contained in:
1 parent
b7e5c3a374
commit
d871ffca6d
1 file changed
+7
-3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user