Conversation
|
If this approach is accepted then I would like to add support for margin trading to BinanceStreamingExchange. But I do not see examples where connect method accepts custom product subscription classes. And this is required because there should be two additional subscription types for two additional channels: margin trades and isolated margin trades |
| AUTO_REPAY; | ||
|
|
||
| @JsonCreator | ||
| public static MarginSideEffectType getSideEffectType(String s) { |
There was a problem hiding this comment.
this method seams pointless as jacksons standard error handling will do a much at reporting an unknown value
There was a problem hiding this comment.
Agree, but this is how it's implemented for other Binance enums. So I just copied the same approach
| } | ||
| } | ||
|
|
||
| private MarginAccountType getMarginAccountTypeFromOrderId(String orderId) { |
There was a problem hiding this comment.
using order id to smuggle the margin accounts id look hacky
is this some kind of convention that comes from binance?
could you point to the documentation where its described?
There was a problem hiding this comment.
This is not a part of official documentation. It's a hack added by me to allow using regular cancelOrder/getOrder API for margin orders without any special parameter types. And it's optional though
# Conflicts: # xchange-binance/src/main/java/org/knowm/xchange/binance/service/BinanceTradeService.java
streaming of margin trading and account data
Adds new order flags to send margin order instead of spot one.
To cancel/retrieve margin order either custom order param structures could be used or account type could be included in order ID (if Include_Margin_Account_Type_In_OrderId exchange parameter is set to true)