Skip to content

Commit

Permalink
Fixed inverted order side for Shared trades
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Nov 21, 2024
1 parent b57ef37 commit be7e752
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async Task<ExchangeWebResult<IEnumerable<SharedTrade>>> IRecentTradeRestClient.G

return result.AsExchangeResult<IEnumerable<SharedTrade>>(Exchange, request.Symbol.TradingMode, result.Data.Reverse().Select(x => new SharedTrade(x.Quantity, x.Price, x.Timestamp)
{
Side = x.BuyerIsMaker ? SharedOrderSide.Buy : SharedOrderSide.Sell
Side = x.BuyerIsMaker ? SharedOrderSide.Sell : SharedOrderSide.Buy,
}).ToArray());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async Task<ExchangeResult<UpdateSubscription>> ITradeSocketClient.SubscribeToTra
var symbol = request.Symbol.GetSymbol(FormatSymbol);
var result = await SubscribeToTradeUpdatesAsync(symbol, update => handler(update.AsExchangeEvent<IEnumerable<SharedTrade>>(Exchange, update.Data.Select(x => new SharedTrade(x.Quantity, x.Price, x.TradeTime)
{
Side = x.BuyerIsMaker ? SharedOrderSide.Buy : SharedOrderSide.Sell
Side = x.BuyerIsMaker ? SharedOrderSide.Sell : SharedOrderSide.Buy,
}).ToArray())), ct).ConfigureAwait(false);

return new ExchangeResult<UpdateSubscription>(Exchange, result);
Expand Down
2 changes: 1 addition & 1 deletion BingX.Net/Clients/SpotApi/BingXRestClientSpotApiShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ async Task<ExchangeWebResult<IEnumerable<SharedTrade>>> IRecentTradeRestClient.G

return result.AsExchangeResult<IEnumerable<SharedTrade>>(Exchange, request.Symbol.TradingMode, result.Data.Select(x => new SharedTrade(x.Quantity, x.Price, x.Timestamp)
{
Side = x.BuyerIsMaker ? SharedOrderSide.Buy : SharedOrderSide.Sell
Side = x.BuyerIsMaker ? SharedOrderSide.Sell : SharedOrderSide.Buy,
}).ToArray());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async Task<ExchangeResult<UpdateSubscription>> ITradeSocketClient.SubscribeToTra
var symbol = request.Symbol.GetSymbol(FormatSymbol);
var result = await SubscribeToTradeUpdatesAsync(symbol, update => handler(update.AsExchangeEvent<IEnumerable<SharedTrade>>(Exchange, new[] { new SharedTrade(update.Data.Quantity, update.Data.Price, update.Data.TradeTime)
{
Side = update.Data.BuyerIsMaker ? SharedOrderSide.Buy : SharedOrderSide.Sell
Side = update.Data.BuyerIsMaker ? SharedOrderSide.Sell : SharedOrderSide.Buy,
} })), ct).ConfigureAwait(false);

return new ExchangeResult<UpdateSubscription>(Exchange, result);
Expand Down

0 comments on commit be7e752

Please sign in to comment.