Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checkpoint- DO NOT MERGE
Browse files Browse the repository at this point in the history
stevenewald committed Oct 8, 2024
1 parent 63f147a commit ce0cd1e
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/exchange-ci.yml
Original file line number Diff line number Diff line change
@@ -356,7 +356,7 @@ jobs:
run: cmake --install build --config Release --prefix .

- name: Move config file
run: cp -r config.yml build/test/config.yml
run: cp config.yml build/test/config.yml

- name: Move test algo files
run: cp -r -L test/src/integration/test_algos build/test/test_algos
3 changes: 3 additions & 0 deletions exchange/src/exchange/matching_cycle/base/base_cycle.cpp
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
#include "common/messages_wrapper_to_exchange.hpp"
#include "exchange/matching/engine.hpp"

#include <iostream>
#include <variant>

namespace nutc::exchange {
@@ -64,12 +65,14 @@ BaseMatchingCycle::match_orders_(std::vector<OrderVariant> orders)
else {
if (order.quantity <= 0.0)
return;
std::cout << "base1" << std::endl;
// TODO: delegate elsewhere
if (order.quantity + order.trader->get_open_bids()
+ order.trader->get_open_asks()
> max_cumulative_order_volume_) {
return;
}
std::cout << "base2" << std::endl;
auto tmp = match_order(order, orderbook, order_fee_);
std::copy(tmp.begin(), tmp.end(), std::back_inserter(matches));
}
3 changes: 3 additions & 0 deletions exchange/src/exchange/traders/trader_types/generic_trader.hpp
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
#include <absl/hash/hash.h>
#include <boost/process.hpp>

#include <iostream>
#include <string>

namespace nutc::exchange {
@@ -66,12 +67,14 @@ class GenericTrader {
void
modify_open_bids(common::decimal_quantity delta)
{
std::cout << "bid" << std::endl;
open_bids_ += delta;
}

void
modify_open_asks(common::decimal_quantity delta)
{
std::cout << "ask" << std::endl;
open_asks_ += delta;
}

0 comments on commit ce0cd1e

Please sign in to comment.