Skip to content

Commit

Permalink
MOD: Improve unit_of_measure_qty docs and fmtting
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Feb 15, 2024
1 parent e5bcdb7 commit 284ac10
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Changed default for `VersionUpgradePolicy` to `Upgrade`
- Changed default `upgrade_policy` for `DbnDecoder`, `AsyncDbnDecoder`, and Python
`DBNDecoder` to `Upgrade` so by default the primary record types can always be used
- Changed text serialization `unit_of_measure_qty` to be affected by `pretty_px`. While
it's not a price, it uses the same fixed-price decimal format as other prices
- Made `StatType` and `VersionUpgradePolicy` non-exhaustive to allow future additions
without breaking changes

Expand Down
4 changes: 2 additions & 2 deletions rust/dbn/src/encode/json/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ mod tests {
low_limit_price: -1_000_000,
max_price_variation: 0,
trading_reference_price: 500_000,
unit_of_measure_qty: 5,
unit_of_measure_qty: 5_000_000_000,
min_price_increment_amount: 5,
price_ratio: 10,
inst_attrib_value: 10,
Expand Down Expand Up @@ -516,7 +516,7 @@ mod tests {
r#""hd":{"ts_event":"2022-07-21T22:17:31.000000000Z","rtype":4,"publisher_id":1,"instrument_id":323}"#,
concat!(
r#""raw_symbol":"ESZ4 C4100","security_update_action":"A","instrument_class":"C","min_price_increment":"0.000000100","display_factor":"1000","expiration":"2023-10-27T23:40:00.000000000Z","activation":"2023-10-15T06:06:40.000000000Z","#,
r#""high_limit_price":"0.001000000","low_limit_price":"-0.001000000","max_price_variation":"0.000000000","trading_reference_price":"0.000500000","unit_of_measure_qty":"5","#,
r#""high_limit_price":"0.001000000","low_limit_price":"-0.001000000","max_price_variation":"0.000000000","trading_reference_price":"0.000500000","unit_of_measure_qty":"5.000000000","#,
r#""min_price_increment_amount":"0.000000005","price_ratio":"0.000000010","inst_attrib_value":10,"underlying_id":256785,"raw_instrument_id":323,"market_depth_implied":0,"#,
r#""market_depth":13,"market_segment_id":0,"max_trade_vol":10000,"min_lot_size":1,"min_lot_size_block":1000,"min_lot_size_round_lot":100,"min_trade_vol":1,"#,
r#""contract_multiplier":0,"decay_quantity":0,"original_contract_size":0,"trading_reference_date":0,"appl_id":0,"#,
Expand Down
1 change: 1 addition & 0 deletions rust/dbn/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ mod tests {
"low_limit_price".to_owned(),
"max_price_variation".to_owned(),
"trading_reference_price".to_owned(),
"unit_of_measure_qty".to_owned(),
"min_price_increment_amount".to_owned(),
"price_ratio".to_owned(),
"strike_price".to_owned(),
Expand Down
4 changes: 3 additions & 1 deletion rust/dbn/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ pub struct InstrumentDefMsg {
#[dbn(fixed_price)]
#[pyo3(get, set)]
pub trading_reference_price: i64,
/// The contract size for each instrument, in combination with `unit_of_measure`.
/// The contract size for each instrument, in combination with `unit_of_measure`, in units
/// of 1e-9, i.e. 1/1,000,000,000 or 0.000000001.
#[dbn(fixed_price)]
#[pyo3(get, set)]
pub unit_of_measure_qty: i64,
/// The value currently under development by the venue. Converted to units of 1e-9, i.e.
Expand Down

0 comments on commit 284ac10

Please sign in to comment.