From afdbf8e10aeeb58f2c2d93dc67aaaf9dd62926f4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 18 Apr 2023 19:03:04 -0400 Subject: [PATCH] `.accounting`: Use `_fqme()` throughout and export decimal converters --- piker/accounting/__init__.py | 18 ++++++++++++++---- piker/accounting/_pos.py | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/piker/accounting/__init__.py b/piker/accounting/__init__.py index eb420bab..d8d1fec9 100644 --- a/piker/accounting/__init__.py +++ b/piker/accounting/__init__.py @@ -32,17 +32,27 @@ from ._pos import ( Position, PpTable, ) +from ._mktinfo import ( + Asset, + dec_digits, + digits_to_dec, + MktPair, +) log = get_logger(__name__) __all__ = [ + 'Asset', + 'dec_digits', + 'digits_to_dec', + 'MktPair', + 'Position', + 'PpTable', 'Transaction', 'TransactionLedger', - 'open_trade_ledger', - 'PpTable', - 'open_pps', 'load_pps_from_ledger', - 'Position', + 'open_pps', + 'open_trade_ledger', ] diff --git a/piker/accounting/_pos.py b/piker/accounting/_pos.py index bbf7ce8c..12c2e19f 100644 --- a/piker/accounting/_pos.py +++ b/piker/accounting/_pos.py @@ -145,7 +145,7 @@ class Position(Struct): # drop symbol obj in serialized form s = d.pop('symbol') fqme = s.fqme - broker, key, suffix = unpack_fqme(fqme) + broker, mktep, venue, suffix = unpack_fqme(fqme) if isinstance(s, Symbol): sym_info = s.broker_info[broker]