XChange
XChange copied to clipboard
Binance streaming adapter buys and sells reversed
org.knowm.xchange.binance.BinanceAdapters has the following method, that sets weather the trade is a buy or sell.
Looking at the order flow, when the buyerMarketMaker=true means that buyer was the maker/seller was the taker, so we want to show this as a sell order as per other markets seems we do the reverse.
Ho
return isBuyer ? OrderType.BID : OrderType.ASK;
}```
as per
https://dev.binance.vision/t/a-little-confusion-about-is-buyer-market-maker-part-of-trade-stream/5660
here is an example with the code fix.
The [email protected] is a buy in the binanace UI and now also a buy via the xchange streaming lib

using this
public static OrderType convertType(boolean isBuyer) {
return isBuyer ? OrderType.ASK : OrderType.BID;
}```
