Closed guilledk closed 2 years ago
soo soo lit. thanks for doing this.
@guilledk what do you think about a simple test that iterates all the backends and runs this (if you haven't done this alread, they wrote before they looked)...
Also, what do i need to try out a feed here? An api key of some sort yah? Can we get some basic instructions in a readme going maybe?
I know this would be handy for any backend that has extra steps beyond public endpoints, so even for trading endpoints.
Even though you know about it the lingering issue where we get a crash because a contract hasn't traded:
tractor._exceptions.RemoteActorError: ('brokerd.deribit', 'e17aca9c-a635-450b-8dd7-1110609f1e9a')
Traceback (most recent call last):
File "/home/goodboy/.virtualenvs/xonsh310/src/tractor/tractor/_actor.py", line 194, in _invoke
res = await coro
File "/home/goodboy/repos/piker/piker/data/feed.py", line 1054, in open_feed_bus
await bus.nursery.start(
File "/home/goodboy/.virtualenvs/xonsh310/lib/python3.10/site-packages/trio/_core/_run.py", line 1036, in start
async with open_nursery() as old_nursery:
File "/home/goodboy/.virtualenvs/xonsh310/lib/python3.10/site-packages/trio/_core/_run.py", line 813, in __aexit__
raise combined_error_from_nursery
File "/home/goodboy/repos/piker/piker/data/feed.py", line 902, in allocate_persistent_feed
init_msg, first_quote = await bus.nursery.start(
File "/home/goodboy/.virtualenvs/xonsh310/lib/python3.10/site-packages/trio/_core/_run.py", line 1036, in start
async with open_nursery() as old_nursery:
File "/home/goodboy/.virtualenvs/xonsh310/lib/python3.10/site-packages/trio/_core/_run.py", line 813, in __aexit__
raise combined_error_from_nursery
File "/home/goodboy/repos/piker/piker/brokers/deribit/feed.py", line 287, in stream_quotes
last_trade = Trade(**(await client.last_trades(
IndexError: list index out of range
This PR started as just adding deribit backend, but as a way to test that backend (and all backends), I also added a new
brokercheck
command inpiker.brokers.cli
.Example command:
piker brokercheck deribit
current output:TODO:
feed_is_live
submit_
trade apisget_
balance and positions as wellEDIT: Futures support and
trade_dialogue
implementation are gonna be left for a future PR, we got crypto option feeds going!