piker icon indicating copy to clipboard operation
piker copied to clipboard

Kraken Refinement

Open iamzoltan opened this issue 3 years ago • 4 comments

To address issues that did not fit into the scope of PR #214 and tick off the remaining desired functionality from #201

  1. [ ] Get trades history asynchronously using nursery and the count:
  • not sure we need this yet since realistically we'll be incrementally capturing trades data in the new ledger system. if we get to the point where user's are complaining about ledger loading on first boot, this might be something worth revisiting.
  1. [x] ~Change the dict merging for trades to the new syntax: https://github.com/pikers/piker/pull/214/files#r830525470~ this code was all rewritten thus obsoleting this change request
  2. [x] Get rid of the try except block in the positions calc: https://github.com/pikers/piker/pull/214/files#r830527334
  3. [x] ~Change fixtures to accept kwargs: https://github.com/pikers/piker/pull/214/files#r817211683~ instead just expect funtools.partial()-ing in of needed state.

Further follow up TODOs (added by @goodboy):

  • [x] ~we should probably use one of their batch cancel endpoints in our Client.submit_cancel()~ such that cc and other automated strats can destroy order sets faster. -> turns out using the WS api makes this all fast enough to avoid needing the batch cancels (for now)
    • [x] the other thing to investigate is whether the ws order entry API doesn't have these same issues with throttling (which one would assume since it's not an extra http request per request). -> it doesn't

iamzoltan avatar Mar 19 '22 21:03 iamzoltan

The one last bit was figuring out the source of latency in order cancellation. I got a feeling it's possibly one of 2 things:

  • their api is putting a speed bump (would be odd though)
  • there's a trio.sleep(1) somewhere that isn't needed in our client

further, we should probably use one of their batch cancel endpoints in our Client.submit_cancel() such that cc and other automated strats can destroy order sets faster.

the other thing to investigate is whether the ws order entry API doesn't have these same issues with throttling (which one would assume since it's not an extra http request per request).

goodboy avatar Mar 22 '22 13:03 goodboy

yea, the batch cancel endpoint I believe is the same as the single cancel one, only you pass in a list. when we use the cc command in piker, do we get all the cancels separately? or do they also come in a batch?

iamzoltan avatar Apr 16 '22 19:04 iamzoltan

I've updated the issue descr with the new issues i found and probably have addressed / solved by now.

goodboy avatar Jul 05 '22 15:07 goodboy

has all this been taking care of in the new branch?

iamzoltan avatar Jul 05 '22 23:07 iamzoltan

Initially completed in https://github.com/pikers/piker/pull/349 and there were a bunch of follow up patches to resolve various issues; see our PR history.

goodboy avatar Mar 02 '23 00:03 goodboy