Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas
This commit is contained in:
commit
2632d7ea9f
2 files changed
+5
-6
No files matched your search
@@ -94,9 +94,7 @@ void compute_synthetic_book(
|
||||
};
|
||||
|
||||
while (!any_legs_empty() && depth-- > 0) {
|
||||
// legs can't be empty, because it is a 1:1 mapping of leg_mkts,
|
||||
// and it has already been established that the latter isn't empty.
|
||||
int limiting_factor = legs[0].curr_level_qty_rem().value();
|
||||
int limiting_factor = std::numeric_limits<int>::max();
|
||||
for (uint32_t i = 0; i < legs.size(); i++) {
|
||||
if (legs[i].curr_level_qty_rem().value() == 0) {
|
||||
legs[i].curr_level++;
|
||||
@@ -178,4 +176,4 @@ void compute_synthetic_book(
|
||||
from_small_book(book_out, sbook_out);
|
||||
}
|
||||
|
||||
} // namespace bts::spartan::mdp3::book_utils
|
||||
} // namespace bts::spartan::mdp3::book_utils
|
||||
@@ -103,13 +103,14 @@ inline void change_unit_qty(
|
||||
bts_assert(unit_remainder > 0);
|
||||
if (it->quantity.value() < unit_remainder) {
|
||||
running_qty += it->quantity.value();
|
||||
running_cost = it->price * it->quantity.value();
|
||||
running_cost += it->price * it->quantity.value();
|
||||
} else {
|
||||
auto qty_in_lev = it->quantity.value();
|
||||
if (running_qty > 0) {
|
||||
running_cost += it->price * unit_remainder;
|
||||
book_out.emplace_back(running_cost, MDP3Quantity(1));
|
||||
qty_in_lev -= unit_remainder;
|
||||
running_cost = md::INT_ZERO;
|
||||
running_qty = 0;
|
||||
}
|
||||
auto unit_lev_remainder = qty_in_lev / unit_qty.value();
|
||||
@@ -146,4 +147,4 @@ void compute_synthetic_book(
|
||||
Book& book_out,
|
||||
const std::vector<std::tuple<MDP3Quantity, md::IntPrice, Book>>& leg_mkts,
|
||||
uint32_t depth);
|
||||
} // namespace bts::spartan::mdp3::book_utils
|
||||
} // namespace bts::spartan::mdp3::book_utils
|
||||
Reference in new issue
Block a user