Skip to content

Commit

Permalink
Set Symbol on spot and usd futures ExchangeData.GetOrderBookAsync res…
Browse files Browse the repository at this point in the history
…ponse
  • Loading branch information
JKorf committed Dec 13, 2024
1 parent 1de6cb5 commit 5c18ce9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public async Task<CallResult<BinanceResponse<BinanceOrderBook>>> GetOrderBookAsy
parameters.AddParameter("symbol", symbol);
parameters.AddOptionalParameter("limit", limit);
int weight = limit <= 100 ? 5 : limit <= 500 ? 25 : limit <= 1000 ? 50 : 250;
return await _client.QueryAsync<BinanceOrderBook>(_client.ClientOptions.Environment.SpotSocketApiAddress.AppendPath("ws-api/v3"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
var result = await _client.QueryAsync<BinanceOrderBook>(_client.ClientOptions.Environment.SpotSocketApiAddress.AppendPath("ws-api/v3"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
if (result)
result.Data.Result.Symbol = symbol;
return result;
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ public async Task<CallResult<BinanceResponse<BinanceFuturesOrderBook>>> GetOrder
parameters.AddParameter("symbol", symbol);
parameters.AddOptionalParameter("limit", limit);
int weight = limit <= 50 ? 2 : limit <= 100 ? 5 : limit <= 500 ? 10 : 20;
return await _client.QueryAsync<BinanceFuturesOrderBook>(_client.ClientOptions.Environment.UsdFuturesSocketApiAddress!.AppendPath("ws-fapi/v1"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
var result = await _client.QueryAsync<BinanceFuturesOrderBook>(_client.ClientOptions.Environment.UsdFuturesSocketApiAddress!.AppendPath("ws-fapi/v1"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
if (result)
result.Data.Result.Symbol = symbol;
return result;
}

#endregion
Expand Down

0 comments on commit 5c18ce9

Please sign in to comment.