Hi, When we are doing high frequency trades, some of our buy orders are matching against our own sell orders (common event id). This is fine, however, when we try to fetch the executed orders using the Margin API (/sapi/v1/margin/myTrades), instead of returning the buy trade and the sell trade for such a scenario, it is returning two buy trades with the same order id and the same quantity. Please see if you can fix this behavior. Thanks
Hi Dino, There is absolutely no difference in the two trades being returned - both have IsBuyer as True, and have same order id, same event id, same quantity with the same sign. This is a bug report
when orders are matched, 2 trade records are generated, one for buyer, the order is for seller, that’s why all of them are returned from the endpoint for self trade.
there is a field, isBuyer, can be used to check the trade even they have the same order id.