pikers / piker

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

kucoin backend #494

Closed jaredgoldman closed 1 year ago

jaredgoldman commented 1 year ago

This PR includes a brokerd module for Kucoin's api. So far, only code for market data has been implemented. This includes:

goodboy commented 1 year ago

@jaredgoldman this ready for serious review?

jaredgoldman commented 1 year ago

@goodboy I think we're ready for some more testing

goodboy commented 1 year ago

@algorandpa seems like i can only stage order with size=0 but other then that historical and live data seems right 🏄🏼

goodboy commented 1 year ago

@jaredgoldman as mentioned in chat as well we've got some kinda strange thing going on with trade rate calcs:

screenshot-2023-03-29_21-32-25


yeah so if you look at how we (currently) implement the trade rate, it's basically just counting the number of vlm-containing-trades (aka clears):

my guess is somehow we've got a tick being generated by ur backend code that's fitting into the trade tick type, without it actually being a trade and thus this count is being triggered?

See https://github.com/pikers/piker/blob/master/piker/fsp/_volume.py#L162 for the filter loop.

hopefully that helps to start digging, if not we can resume in chat 👍🏼

jaredgoldman commented 1 year ago

@goodboy merged the binance changes and added anext()

goodboy commented 1 year ago

Looking the code in the ol' vim i'm seeing a lot of these brother:

screenshot-2023-04-14_19-03-31

goodboy commented 1 year ago

Added patch commit to get things working again after your review changes in #498

jaredgoldman commented 1 year ago

@goodboy I refactored the subscribe and stream_messages logic to:

lol, the earlier implementation was wildy inefficient spawning a diff ws connection and ping task for each symbol. In addition I've addressed the comments for which I'm not waiting on a reply from you (no rush). We're also getting to the point where we should consider factoring this into a few different files, especially before adding order control.

goodboy commented 1 year ago

We're also getting to the point where we should consider factoring this into a few different files, especially before adding order control.

yes, if you want to in this PR it's fine by me. currently we something like:

jaredgoldman commented 1 year ago

@goodboy https://github.com/pikers/piker/issues/499

goodboy commented 1 year ago

@jaredgoldman :boom:

excellent work yet again compadre 🏄🏼

nice follow up issue and final linting before getting this in ma dawg!