Skip to main content

Module rules

Module rules 

Source
Expand description

An instrument’s order rules (tick, lot step, minimums and maximums) and the check of an order against them before it is sent.

A venue publishes, per instrument, the grid a price and a quantity must sit on and the range each must fall in. A client that loads those rules refuses an order that breaks them without sending it, so the caller gets a typed error that says which value and which limit (OrderError::InvalidPrecision for the grid, OrderError::OutOfBounds for the range) rather than a venue’s text after a round trip. It never rounds: rounding would place a different order from the one asked for. A caller that sizes or prices an order puts it on the grid first, with ValueRule::round_down / ValueRule::round_up, or OrderRules::round_quantity_down / OrderRules::round_quantity_up for a quantity.

A pass is not a guarantee. The check covers the rules a client has loaded, from the last time it loaded them, and only the ones that can be read off the request. The venue has the last say.

Structs§

OrderRules
One instrument’s order rules.
ValueRule
The grid and range of one kind of value: a price, a quantity or a notional.

Enums§

PreSendRules
Whether a client checks an order against its instrument’s OrderRules before sending it.