Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions MatchingEngine/src/Market.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,8 @@ void Market::on_depth_change(const DepthOrderBook *book,
std::stringstream ss;
MarketDataIncrementalRefreshLogger::log(ss, md_update->priceDepth);
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
std::cout << "Update : " << ss.str() << std::endl;

int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks
int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks

auto current_stats = stats_ptr_->find(book->symbol());

Expand Down
6 changes: 1 addition & 5 deletions MatchingEngine/src/Order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Order::onRejected(const char *reason) {}
void Order::onFilled(liquibook::book::Quantity fill_qty,
liquibook::book::Cost fill_cost) {
quantityOnMarket_ -= fill_qty;
fillCost_ += fill_cost;
fillCost_ += (fill_cost * fill_qty);
quantityFilled_ += fill_qty;

std::stringstream msg;
Expand Down Expand Up @@ -243,10 +243,6 @@ void Order::populateExecutionReport(
executionReport.TimeInForce(FIX::TimeInForce_DAY);
}


// std::cout << "Transact Time : " << ACE_OS::gettimeofday().msec() << ":" <<
// executionReport.TransactTime << std::endl;

if (quantityFilled() > 0)
executionReport.AvgPx(std::nearbyint(fillCost() / quantityFilled())); // round to the nearest tick
else
Expand Down
34 changes: 11 additions & 23 deletions MatchingEngine/src/PriceDepthPublisherService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,21 @@ int PriceDepthPublisherService::service()
//
// Iterate through the queue and get the latest update
//

/*std::cout << "Queue Size : "
<< _price_depth_publisher_queue_ptr->size()
<< std::endl;*/

std::shared_ptr<DistributedATS::MarketDataUpdate> market_data_update;
std::shared_ptr<DistributedATS::MarketDataUpdate> market_data_update;

std::map<std::string,
DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh>
latestMarketDataUpdates;
std::map<std::string,
DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh>
latestMarketDataUpdates;


while (_price_depth_publisher_queue_ptr->pop(market_data_update))
{
latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth;

std::stringstream ss;
MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]);
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
std::cout << "Update : " << ss.str() << std::endl;
while (_price_depth_publisher_queue_ptr->pop(market_data_update))
{
latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth;

}
std::stringstream ss;
MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]);
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
}


DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh
chunkedIncrementalMarketDataRefresh;

Expand Down Expand Up @@ -132,8 +123,6 @@ int PriceDepthPublisherService::service()
chunkedIncrementalMarketDataRefresh,
"MarketDataIncrementalRefresh");

std::cout << "Publishing chunk of " << chunkedIncrementalMarketDataRefresh.c_NoMDEntries().size() << " updates" << std::endl;

std::stringstream ss;
MarketDataIncrementalRefreshLogger::log(
ss, chunkedIncrementalMarketDataRefresh);
Expand All @@ -144,7 +133,6 @@ int PriceDepthPublisherService::service()
if (ret != eprosima::fastdds::dds::RETCODE_OK) {
LOG4CXX_ERROR(logger, "MarketDataIncrementalRefresh :" << ret);
}

}
}

Expand Down
4 changes: 1 addition & 3 deletions MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ void SecurityListDataReaderListenerImpl::on_data_available(
std::stringstream ss;
SecurityListLogger::log(ss, security_list);
LOG4CXX_INFO(logger, "SecurityList : [" << ss.str() << "]");

std::cout << "Security:" << ss.str() << std::endl;


for (uint32_t sec_index = 0; sec_index < security_list.c_NoRelatedSym().size(); sec_index++)
{
std::string instrument = security_list.c_NoRelatedSym()[sec_index].Symbol();
Expand Down
7 changes: 0 additions & 7 deletions MatchingEngine/src/SecurityListRequestDataWriterListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
if (info.current_count_change > 0)
{
matched_ = info.total_count;
//std::cout << "[Listener] Publisher Matched: " << matched_ << std::endl;

// Start thread only once
bool expected = false;
Expand All @@ -36,7 +35,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
std::thread([this, dwr]() {
while (!_market_ptr->get_ready_to_trade())
{
//std::cout << "[Listener] Publishing Security Lise Exchange " << matched_ << std::endl;
_market_ptr->publishSecurityListRequest(dwr);
std::this_thread::sleep_for(std::chrono::seconds(1));
}
Expand All @@ -46,11 +44,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
else if (info.current_count_change == -1)
{
matched_ = info.total_count;
std::cout << "[Listener] Publisher UnMatched: " << matched_ << std::endl;
}
else
{
std::cout << "[Listener] Invalid current_count_change: " << info.current_count_change << std::endl;
}
}

Expand Down
3 changes: 1 addition & 2 deletions MiscATS/CryptoCLOB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ The first matching engine consumes and processes orders from the instrument grou
### Starting ATS

```
cd $DATS_HOME/MiscATS/CryptoCLOB/scipts
./start_ats
BASEDIR_ATS=`pwd`/CryptoCLOB python3 start_ats.py --ats CryptoCLOB/crypto_ats.json
```

## Test client
Expand Down
3 changes: 1 addition & 2 deletions MiscATS/MultiMatchingEngineATS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ The first matching engine consumes and processes orders from the instrument grou
### Starting ATS

```
cd $DATS_HOME/MiscATS/MultiMatchingEngineATS/scipts
./start_ats
BASEDIR_ATS=`pwd`/MultiMatchingEngineATS python3 start_ats.py --ats MultiMatchingEngineATS/multi_matching_engine.json
```

## Test client
Expand Down
3 changes: 1 addition & 2 deletions MiscATS/USTreasuryCLOB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ The matching engine consumes and processes orders from the instrument group MARK
### Starting ATS

```
cd $DATS_HOME/MiscATS/USTreasuryCLOB/scipts
./start_ats
BASEDIR_ATS=`pwd`/USTreasuryCLOB python3 start_ats.py --ats USTreasuryCLOB/ust_ats.json
```

## Test client
Expand Down
16 changes: 8 additions & 8 deletions cmake/DDSConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ if(NOT EXISTS "${DDS_INCLUDE_DIRS}/fastdds/config.hpp")

include(ExternalProject)


ExternalProject_Add(ASIO
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-28-0
UPDATE_DISCONNECTED TRUE
SOURCE_SUBDIR asio
INSTALL_DIR ${DDS_INSTALL_PREFIX}
CONFIGURE_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && ./autogen.sh && ./configure --prefix=${DDS_INSTALL_PREFIX} --exec-prefix=${DDS_INSTALL_PREFIX} --without-boost
BUILD_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && make
INSTALL_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && make install
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-28-0
UPDATE_DISCONNECTED TRUE
SOURCE_SUBDIR asio
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/asio/include ${DDS_INSTALL_PREFIX}/include
)

ExternalProject_Add(FoonathanMemory
Expand Down