diff --git a/piker/accounting/_ledger.py b/piker/accounting/_ledger.py index 4073b3a6..23845fde 100644 --- a/piker/accounting/_ledger.py +++ b/piker/accounting/_ledger.py @@ -54,8 +54,8 @@ class Transaction(Struct, frozen=True): # TODO: unify this with the `MktPair`, # once we have that as a required field, - # we don't really need the fqsn any more.. - fqsn: str + # we don't really need the fqme any more.. + fqme: str tid: Union[str, int] # unique transaction id size: float @@ -68,11 +68,6 @@ class Transaction(Struct, frozen=True): # via the `MktPair`? expiry: datetime | None = None - # remap for back-compat - @property - def fqme(self) -> str: - return self.fqsn - # TODO: drop the Symbol type, construct using # t.sys (the transaction system) @@ -174,7 +169,7 @@ class TransactionLedger(UserDict): continue tx = Transaction( - fqsn=fqme, + fqme=fqme, tid=txdict['tid'], dt=dt, price=txdict['price'], diff --git a/piker/accounting/_pos.py b/piker/accounting/_pos.py index 2d3700bc..bc84f5b7 100644 --- a/piker/accounting/_pos.py +++ b/piker/accounting/_pos.py @@ -900,7 +900,7 @@ def open_pps( clears_table['dt'] = dt trans.append(Transaction( - fqsn=bs_mktid, + fqme=bs_mktid, sym=mkt, bs_mktid=bs_mktid, tid=tid, diff --git a/piker/brokers/ib/broker.py b/piker/brokers/ib/broker.py index 800baed7..1667d5f8 100644 --- a/piker/brokers/ib/broker.py +++ b/piker/brokers/ib/broker.py @@ -1266,7 +1266,7 @@ def norm_trade_records( insort( records, Transaction( - fqsn=fqme, + fqme=fqme, sym=pair, tid=tid, size=size, diff --git a/piker/brokers/kraken/api.py b/piker/brokers/kraken/api.py index 026dca71..24330638 100644 --- a/piker/brokers/kraken/api.py +++ b/piker/brokers/kraken/api.py @@ -401,7 +401,7 @@ class Client: fqme = asset_key + '.kraken' tx = Transaction( - fqsn=fqme, + fqme=fqme, sym=asset, tid=entry['txid'], dt=pendulum.from_timestamp(entry['time']), diff --git a/piker/brokers/kraken/broker.py b/piker/brokers/kraken/broker.py index 994b7158..0a9056af 100644 --- a/piker/brokers/kraken/broker.py +++ b/piker/brokers/kraken/broker.py @@ -895,7 +895,7 @@ async def handle_order_updates( ids.inverse.get(reqid) is None ): # parse out existing live order - fqsn = pair.replace('/', '').lower() + fqme = pair.replace('/', '').lower() price = float(price) size = float(vol) @@ -922,7 +922,7 @@ async def handle_order_updates( action=action, exec_mode='live', oid=oid, - symbol=fqsn, + symbol=fqme, account=acc_name, price=price, size=size, @@ -1207,7 +1207,7 @@ async def norm_trade_records( mkt: MktPair = (await get_mkt_info(fqme))[0] records[tid] = Transaction( - fqsn=fqme, + fqme=fqme, sym=mkt, tid=tid, size=size, diff --git a/piker/clearing/_paper_engine.py b/piker/clearing/_paper_engine.py index 373f5bcf..d6e29245 100644 --- a/piker/clearing/_paper_engine.py +++ b/piker/clearing/_paper_engine.py @@ -263,7 +263,7 @@ class PaperBoi(Struct): # other then this thing, our fqme address. bs_mktid: str = fqme t = Transaction( - fqsn=fqme, + fqme=fqme, sym=self._mkts[fqme], tid=oid, size=size, @@ -577,9 +577,9 @@ async def trades_dialogue( mkt_by_fqme[fqme] = mkt # for each sym in the ledger load it's `MktPair` info - for tid, tdict in ledger.data.items(): + for tid, txdict in ledger.data.items(): # TODO: switch this to fqme - l_fqme = tdict['fqsn'] + l_fqme = txdict.get('fqme', txdict['fqsn']) if ( gmi