Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
slick::sim::engine::ProRataConfig Struct Reference

Pro-rata allocation rules. Quantities use the venue's fixed-point scale. More...

#include <matching_engine/matching_config.hpp>

Collaboration diagram for slick::sim::engine::ProRataConfig:

Public Member Functions

void validate () const
 Throws std::invalid_argument unless lot_size > 0, min_allocation >= 0 and fifo_percent <= 100.
bool operator== (const ProRataConfig &) const =default

Public Attributes

qty_t lot_size = DOUBLE_MULTIPLIER
 allocations round down to whole lots
qty_t min_allocation = 0
 a pro-rata share below this rounds to zero
uint8_t fifo_percent = 0
 share of the incoming quantity filled FIFO before pro-rata

Detailed Description

Pro-rata allocation rules. Quantities use the venue's fixed-point scale.

Definition at line 11 of file matching_config.hpp.

Member Function Documentation

◆ operator==()

bool slick::sim::engine::ProRataConfig::operator== ( const ProRataConfig & ) const
default

◆ validate()

void ProRataConfig::validate ( ) const

Throws std::invalid_argument unless lot_size > 0, min_allocation >= 0 and fifo_percent <= 100.

A zero lot divides by zero, and a percentage over 100 allocates more than the aggressor has.

Definition at line 47 of file matching_config.cpp.

References fifo_percent, lot_size, min_allocation, and slick::sim::to_qty_double().

Referenced by slick::sim::engine::MatchingConfig::from_json().

Member Data Documentation

◆ fifo_percent

uint8_t slick::sim::engine::ProRataConfig::fifo_percent = 0

share of the incoming quantity filled FIFO before pro-rata

Definition at line 14 of file matching_config.hpp.

Referenced by slick::sim::engine::MatchingConfig::from_json(), and validate().

◆ lot_size

qty_t slick::sim::engine::ProRataConfig::lot_size = DOUBLE_MULTIPLIER

allocations round down to whole lots

Definition at line 12 of file matching_config.hpp.

Referenced by slick::sim::engine::MatchingConfig::from_json(), and validate().

◆ min_allocation

qty_t slick::sim::engine::ProRataConfig::min_allocation = 0

a pro-rata share below this rounds to zero

Definition at line 13 of file matching_config.hpp.

Referenced by slick::sim::engine::MatchingConfig::from_json(), and validate().


The documentation for this struct was generated from the following files: