Skip to content

Commit

Permalink
Delete dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald committed Jan 9, 2025
1 parent 416ae20 commit ecae00f
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 99 deletions.
1 change: 0 additions & 1 deletion exchange/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ add_library(

src/exchange/bots/bot_container.cpp
src/exchange/bots/bot_types/retail.cpp
src/exchange/bots/variance.cpp
src/exchange/bots/bot_types/market_maker.cpp

src/exchange/matching/engine.cpp
Expand Down
13 changes: 7 additions & 6 deletions exchange/src/exchange/bots/bot_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "common/types/decimal.hpp"
#include "exchange/bots/bot_types/market_maker.hpp"
#include "exchange/bots/bot_types/retail.hpp"
#include "exchange/bots/shared_bot_state.hpp"
#include "exchange/traders/trader_container.hpp"

#include <cmath>
Expand All @@ -16,8 +17,6 @@ BotContainer::generate_orders(
common::decimal_price midprice, common::decimal_price theo
)
{
variance_calculator_.record_price(midprice);

common::decimal_price cumulative_interest_limit{};
common::decimal_quantity cumulative_quantity_held{};

Expand All @@ -27,10 +26,12 @@ BotContainer::generate_orders(
bot->get_portfolio().get_holdings(bot->get_ticker());
}

return generate_orders(
{midprice, theo, variance_calculator_.calculate_volatility(),
cumulative_interest_limit, cumulative_quantity_held}
);
generate_orders(shared_bot_state{
.MIDPRICE = midprice,
.THEO = theo,
.CUMULATIVE_INTEREST_LIMIT = cumulative_interest_limit,
.CUMULATIVE_QUANTITY_HELD = cumulative_quantity_held
});
}

template <class BotType>
Expand Down
2 changes: 0 additions & 2 deletions exchange/src/exchange/bots/bot_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "exchange/traders/trader_container.hpp"
#include "exchange/traders/trader_types/bot_trader.hpp"
#include "shared_bot_state.hpp"
#include "variance.hpp"

namespace nutc::exchange {

Expand All @@ -13,7 +12,6 @@ namespace nutc::exchange {
*/
class BotContainer {
using BotVector = std::vector<std::shared_ptr<BotTrader>>;
VarianceCalculator variance_calculator_;

BotVector bots_{};

Expand Down
1 change: 0 additions & 1 deletion exchange/src/exchange/bots/shared_bot_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace nutc::exchange {
struct shared_bot_state {
const common::decimal_price MIDPRICE;
const common::decimal_price THEO;
const common::decimal_quantity REALIZED_VOLATILITY;
const common::decimal_price CUMULATIVE_INTEREST_LIMIT;
const common::decimal_quantity CUMULATIVE_QUANTITY_HELD;
};
Expand Down
63 changes: 0 additions & 63 deletions exchange/src/exchange/bots/variance.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions exchange/src/exchange/bots/variance.hpp

This file was deleted.

1 change: 1 addition & 0 deletions exchange/src/exchange/orders/ticker_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ std::vector<TickerData>
TickerContainer::create_tickers()
{
std::vector<TickerData> result;
result.reserve(common::TICKERS.size());
for (std::size_t ticker = 0; ticker < common::TICKERS.size(); ticker++) {
result.emplace_back(static_cast<common::Ticker>(ticker));
}
Expand Down
4 changes: 0 additions & 4 deletions exchange/src/exchange/orders/ticker_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
#include "common/types/decimal.hpp"
#include "common/types/ticker.hpp"
#include "exchange/bots/bot_container.hpp"
#include "exchange/config/dynamic/ticker_config.hpp"
#include "exchange/orders/orderbook/composite_orderbook.hpp"
#include "exchange/theo/brownian.hpp"
#include "exchange/traders/trader_container.hpp"

#include <absl/hash/hash.h>

namespace nutc::exchange {

Expand Down

0 comments on commit ecae00f

Please sign in to comment.