pikers / piker

(e2e) foss trading for non-tinas
GNU Affero General Public License v3.0
102 stars 17 forks source link

symbol case `KeyError` on 2nd sym loaded #435

Closed goodboy closed 1 year ago

goodboy commented 1 year ago

I've noticed this now both with kraken and binance backends. Error is something along the lines of:

Traceback (most recent call last):
  File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 196, in _invoke
    res = await coro
  File "/home/goodboy/repos/piker/piker/data/feed.py", line 1140, in open_feed_bus
    await bus.nursery.start(
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio/_core/_run.py", line 1085, in start
    async with open_nursery() as old_nursery:
  File "/home/goodboy/.virtualenvs/piker310/lib/python3.10/site-packages/trio/_core/_run.py", line 850, in __aexit__
    raise combined_error_from_nursery
  File "/home/goodboy/repos/piker/piker/data/feed.py", line 966, in allocate_persistent_feed
    msg = init_msg[symstr]
KeyError: 'LTCEUR'

[4] > /home/goodboy/repos/piker/piker/data/feed.py(966)allocate_persistent_feed()
-> msg = init_msg[symstr]

Explanation

seems to be either of:

I can't tell yet if this is cex specific or not but does seem to be a discrepancy between the input symbol key from the search results to the lookup by the feed machinery to get sym info:

LTCEUR -> -> init_msg: dict contains lower case version of key.


possible solution(s)

probably best one is keeping lowercase symbol keys throughout the data feed stuff and making sure that binance adheres to this in particular..