|
Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
|
Pro-rata matching: at each price level an aggressor that cannot take the whole level is split across its orders by size, not by queue position. More...
#include <matching_engine/pro_rata_matching_engine.hpp>
Classes | |
| struct | Allocation |
| One resting order's share of an aggressor at a level. More... | |
Public Member Functions | |
| ProRataMatchingEngine (slick::queue< OrderResponse > &response_queue, const ProRataConfig &config={}) | |
| ~ProRataMatchingEngine () override=default | |
| MatchingEngine::Type | type () const noexcept override |
| const ProRataConfig & | config () const noexcept |
| std::tuple< OrdRejectReason, std::vector< TradeSummaryInfo > > | match (Order *order, price_t order_price, qty_t order_qty, OrderBook &book, time_t request_time, time_t event_time, uint64_t seq_num=0, SelfMatchPreventionMode smp_mode=SelfMatchPreventionMode::NONE) override |
| std::vector< TradeSummaryInfo > | match (Side side, uint64_t order_id, price_t price, qty_t &qty, OrderBook &book, time_t event_time, uint64_t seq_num=0) override |
| Public Member Functions inherited from slick::sim::engine::MatchingEngine | |
| MatchingEngine (slick::queue< OrderResponse > &response_queue) | |
| virtual | ~MatchingEngine ()=default |
| void | publishOrderAck (const Order *order, time_t request_time) |
| void | publishOrderExecution (const Order *order, bool aggressor) |
| aggressor: the order crossed the spread, as opposed to resting and being hit. | |
| void | publishOrderModify (const Order *order, price_t new_price, qty_t new_qty, time_t request_time) |
| void | publishOrderCancel (const Order *order, time_t request_time) |
Additional Inherited Members | |
| Public Types inherited from slick::sim::engine::MatchingEngine | |
| enum | Type : uint8_t { FIFO , ProRata , __count__ } |
| Static Public Member Functions inherited from slick::sim::engine::MatchingEngine | |
| static uint64_t | nextTradeId () noexcept |
| Protected Attributes inherited from slick::sim::engine::MatchingEngine | |
| slick::queue< OrderResponse > & | response_queue_ |
| Static Protected Attributes inherited from slick::sim::engine::MatchingEngine | |
| static std::atomic< uint64_t > | next_trade_id_ {1} |
Pro-rata matching: at each price level an aggressor that cannot take the whole level is split across its orders by size, not by queue position.
Per level, for incoming quantity Q against orders of total T:
One instance serves every symbol of a venue and is only ever called from the exchange thread, so its scratch buffer needs no synchronisation.
Definition at line 23 of file pro_rata_matching_engine.hpp.
| ProRataMatchingEngine::ProRataMatchingEngine | ( | slick::queue< OrderResponse > & | response_queue, |
| const ProRataConfig & | config = {} ) |
Definition at line 19 of file pro_rata_matching_engine.cpp.
References slick::sim::engine::MatchingEngine::MatchingEngine(), and config().
|
overridedefault |
|
inlinenoexcept |
Definition at line 40 of file pro_rata_matching_engine.hpp.
Referenced by ProRataMatchingEngine().
|
overridevirtual |
Implements slick::sim::engine::MatchingEngine.
Definition at line 174 of file pro_rata_matching_engine.cpp.
References slick::sim::BUY, and slick::sim::Order::side.
|
overridevirtual |
Implements slick::sim::engine::MatchingEngine.
Definition at line 180 of file pro_rata_matching_engine.cpp.
References slick::sim::BUY.
|
inlineoverridevirtualnoexcept |
Implements slick::sim::engine::MatchingEngine.
Definition at line 36 of file pro_rata_matching_engine.hpp.
References slick::sim::engine::MatchingEngine::ProRata.