Skip to content

Commit

Permalink
Add order book limit 5000 and 10000 rate limits
Browse files Browse the repository at this point in the history
Do not add 10000 limit to comment since it was temporarily removed -- 2019-08-16 (Update 2).
  • Loading branch information
sonvister committed Sep 20, 2019
1 parent a2676dd commit 41891be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Binance/Extensions/BinanceHttpClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ await client.RateLimiter.DelayAsync(token: token)
/// </summary>
/// <param name="client"></param>
/// <param name="symbol"></param>
/// <param name="limit">Valid values: [5, 10, 20, 50, 100, 500, 1000] (default: 100).</param>
/// <param name="limit">Valid values: [5, 10, 20, 50, 100, 500, 1000, 5000] (default: 100).</param>
/// <param name="token"></param>
/// <returns></returns>
public static async Task<string> GetOrderBookAsync(this IBinanceHttpClient client, string symbol, int limit = default, CancellationToken token = default)
Expand All @@ -114,7 +114,11 @@ public static async Task<string> GetOrderBookAsync(this IBinanceHttpClient clien
if (client.RateLimiter != null)
{
await client.RateLimiter
.DelayAsync(limit >= 1000 ? 10 : limit >= 500 ? 5 : 1, token)
.DelayAsync(limit >= 10000 ? 100
: limit >= 5000 ? 50
: limit >= 1000 ? 10
: limit >= 500 ? 5
: 1, token)
.ConfigureAwait(false);
}

Expand Down

0 comments on commit 41891be

Please sign in to comment.