question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for bulk add/update/cancel orders

See original GitHub issue

Hi folks,

i would like to create a PR and introduce additional methods in the interface org.knowm.xchange.service.trade.TradeService to support bulk operations for order management. The new methods could look like this:

  default List<Try<Boolean>> bulkCancelOrders(List<CancelOrderParams> orderParams) throws IOException {
    throw new NotYetImplementedForExchangeException();
  }
  default List<Try<String>> bulkPlaceLimitOrders(List<LimitOrder> limitOrder) throws IOException {
    throw new NotYetImplementedForExchangeException();
  }
  default List<Try<String>> bulkUpdateLimitOrders(List<LimitOrder> limitOrder) throws IOException {
    throw new NotYetImplementedForExchangeException();
  }

there are multiple exchanges, which do support bulk operations, like bitmex and finex. in my proposal i used the Try pattern, the Try interface can have two concrete classes: Failure and Success. The pattern is well implemented in the vavr library http://www.vavr.io/

@timmolter what do you think? i would add the additional dependency for vavr and implement the methods for BitMEX and Finex. One need to check than, which other platforms do support the bulk operations.

There are good reasons to use the bulk operations. First thing: you can submit your orders much faster, the second one: youo will not get issues with too frequent requests, which is unfortunatelly very often the case. Here for example one passage from the BitMEX doc:

Due to how BitMEX does real-time auditing, risk checks, and margining, orders submitted, amended, and canceled in bulk are faster to execute. For this reason, bulk actions are ratelimited at 1/10 the normal rate! Bulk cancels, regardless of count, always only count as one request.

cheers andre

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
walec51commented, Sep 28, 2018

all the same, generic interfaces are for generic features if only few exchanges implement a feature then it is not generic and if you cannot even simulate it by using existing generic features then it should not go to generic interfaces

0reactions
cympcommented, Sep 28, 2018

What about declaring the methods common to several exchanges but not all (@andre77 case) in the interface with something like “throws NotSupportedByExchange” instead of a default implementation throwing a NotYetImplementedForExchangeException? This way the development is protected at compilation time as we would have to take care of a possible unsupported feature, a bit better than having NotYetImplementedForExchangeException thrown at runtime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using bulk actions in your Shopify admin
You can perform actions in bulk in the Shopify Admin. For example, you can fulfill many orders, delete many files, or publish many...
Read more >
Add or edit account budgets in bulk - Google Ads Help
All ad serving is paused once this budget amount is reached. See below instructions for editing budgets, if you want to change this...
Read more >
Bulk update custom user profile properties for SharePoint Online
To replicate custom attributes to the SharePoint user profile service, use the UserProfile.BatchUpdate.API.
Read more >
AD Bulk Users Manual - Dovestones Software
AD Bulk Users is a simple to use yet powerful application that allows you to import or update large numbers of Active Directory...
Read more >
Bulk operations - Amazon Advertising Advanced Tools Center
If a Bulksheets user trying to create new Ad Group and Ads for a Sponsored ... Doing so will enable you to either...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found