Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
matching_config.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "matching_engine.hpp"
4#include <common/types.hpp>
5#include <nlohmann/json.hpp>
6#include <memory>
7
8namespace slick::sim::engine {
9
14 uint8_t fifo_percent = 0;
15
19 void validate() const;
20
21 bool operator==(const ProRataConfig &) const = default;
22};
23
36
37std::unique_ptr<MatchingEngine> createMatchingEngine(const MatchingConfig &config,
38 slick::queue<OrderResponse> &response_queue);
39
40} // namespace slick::sim::engine
std::unique_ptr< MatchingEngine > createMatchingEngine(const MatchingConfig &config, slick::queue< OrderResponse > &response_queue)
constexpr int32_t DOUBLE_MULTIPLIER
Definition types.hpp:29
int_fast64_t qty_t
Definition types.hpp:22
Which engine a venue's symbols match with.
static MatchingConfig from_json(const nlohmann::json &config)
Reads matching_algorithm ("fifo" by default, or "pro_rata") and, for pro-rata, the pro_rata block: lo...
Pro-rata allocation rules. Quantities use the venue's fixed-point scale.
bool operator==(const ProRataConfig &) const =default
qty_t min_allocation
a pro-rata share below this rounds to zero
void validate() const
Throws std::invalid_argument unless lot_size > 0, min_allocation >= 0 and fifo_percent <= 100.
uint8_t fifo_percent
share of the incoming quantity filled FIFO before pro-rata
qty_t lot_size
allocations round down to whole lots