Skip to content

kucoin backend#494

Merged
jaredgoldman merged 82 commits intomasterfrom
kucoin_backend
Apr 22, 2023
Merged

kucoin backend#494
jaredgoldman merged 82 commits intomasterfrom
kucoin_backend

Conversation

@jaredgoldman
Copy link
Contributor

@jaredgoldman jaredgoldman commented Mar 19, 2023

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

  • Fetching a users historical trades
  • Subscribing to real-time market data via the Kucoin websocket feed
  • Multi-chartz support
  • Fetching OHLC historical market data
  • Kucoin user auth
  • Symbol fuzzy search

Remaining tasks for full support are detailed in #499

@jaredgoldman jaredgoldman self-assigned this Mar 19, 2023
@jaredgoldman jaredgoldman force-pushed the kucoin_backend branch 3 times, most recently from 9d794d3 to 57587c9 Compare March 19, 2023 18:30
@goodboy
Copy link
Contributor

goodboy commented Mar 23, 2023

@jaredgoldman this ready for serious review?

@jaredgoldman
Copy link
Contributor Author

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

@goodboy
Copy link
Contributor

goodboy commented Mar 30, 2023

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

@goodboy
Copy link
Contributor

goodboy commented Apr 1, 2023

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

  • there's some kind of trade event being picked up by the fsp system 10/sec
  • you can see flat curve for this if you leave it running
  • this does not match up with actual vlm / clearing rates

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 👍🏼

Copy link
Contributor

@goodboy goodboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other then this linting output (which i think i've hassled
screenshot-2023-04-17_18-29-54
about enough at this point) 😂

This is sooo close.

I have couple more quiffs mostly to do with typing 🥱

Testing says this is basically ready to land, even playing with the paper clearing engine a bunch as well as overlays 👍🏼

@goodboy
Copy link
Contributor

goodboy commented Apr 17, 2023

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:

  • core backend api client and general utils in .api
  • data feed setup, search task and history client in a .feed
  • all the trade control stuff (which i don't think you have any of yet) in a .broker

Copy link
Contributor

@goodboy goodboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredgoldman other then a couple more suggestions that I don't think you need to change right now in this PR (particularly bc i just had to entirely rework open_autiorecon_ws() in #489 😂) and this little bit of linting i was still able to catch:

screenshot-2023-04-21_14-11-19

I think this is more then ready to land!

Great work yet again and glad to see our backend crypto set expanding using trio native machnery 🏄🏼

Only last thing is please move all the outstanding todo tasks and follow up into another issue that links to this one before you merge this.

Other then that please merge at your leisure 🐶

@jaredgoldman
Copy link
Contributor Author

@goodboy #499

@jaredgoldman jaredgoldman merged commit 1ea0163 into master Apr 22, 2023
@jaredgoldman jaredgoldman deleted the kucoin_backend branch April 22, 2023 01:33
@goodboy
Copy link
Contributor

goodboy commented Apr 22, 2023

@jaredgoldman 💥

excellent work yet again compadre 🏄🏼

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

@goodboy goodboy mentioned this pull request Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants