2#include <slick/logger.hpp>
8 symbol_->onPriceLevelUpdate(update);
17 LOG_INFO(
"{} Adding order {}: oid={}, client_oid={}, price={}, qty={}, tif={}",
35 LOG_INFO(
"{} Order {} cannot rest (TIF={}, market={}), not adding to book (leaves_qty={})",
41 if (!resting) [[unlikely]] {
55 return std::make_tuple(reject_reason, trade_summaries);
64 const bool requeue = new_price != order->
price || new_qty > order->
quantity;
86 return std::make_tuple(reject_reason, trade_summaries);
100 .event_time = update.timestamp,
101 .seq_num = update.seq_num,
102 .price = update.price,
103 .qty = update.quantity,
104 .num_orders = update.num_orders,
105 .level_index = update.level_index,
108 .side =
static_cast<Side>(update.side)
116 if (update.isDelete()) {
118 }
else if (update.old_qty == 0 && update.old_price == 0) {
123 .order_id = update.order_id,
124 .event_time = update.timestamp,
125 .priority = update.priority,
126 .price = update.price,
127 .qty = update.quantity,
128 .side =
static_cast<Side>(update.side),
129 .update_action = action
static uint64_t nextOrderPriority() noexcept
One sequence shared by every book, so it is drawn from atomically: each exchange runs on its own thre...
std::string_view view() const noexcept
Helpers for a venue whose one config entry describes several independent exchange instances,...
uint64_t get_current_time_ns()
constexpr price_t NULL_PRICE
slick::orderbook::PriceLevelUpdate PriceLevelUpdate
constexpr double to_price_double(price_t price)
slick::orderbook::OrderUpdate OrderUpdate
constexpr const char * to_string(FeedState state) noexcept
constexpr double to_qty_double(qty_t qty)
utils::fixed_string< 37 > client_order_id
utils::fixed_string< 37 > order_id
bool restsRemainder() const noexcept
Whether what matching leaves of it rests on the book; otherwise it is cancelled.
TimeInForce time_in_force
uint64_t last_update_time
void onOrderUpdate(const OrderUpdate &update) override
void onPriceLevelUpdate(const PriceLevelUpdate &update) override
SelfMatchPreventionMode smp_mode_
symbol_name_t symbol_
Stored at wire width so publishing can copy the whole field without reading past the end of a shorter...
void cancelOrder(Order *order, time_t request_time)
std::tuple< OrdRejectReason, std::vector< TradeSummaryInfo > > addOrder(Order *order, time_t request_time)
engine::MatchingEngine * matching_engine_
std::vector< MDLevel > md_level_update_cache_
void onOrderUpdate(const OrderUpdate &update)
Called when an individual order is updated (L3 event).
std::vector< MDOrder > md_order_update_cache_
std::shared_ptr< OrderBook > order_book_
void onPriceLevelUpdate(const PriceLevelUpdate &update)
std::tuple< OrdRejectReason, std::vector< TradeSummaryInfo > > modifyOrder(Order *order, price_t new_price, qty_t new_qty, time_t request_time)