Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binance-0.2.0-alpha29: Error RateLimiter.DelayAsync count must not be less than 1 #54

Closed
rakewell opened this issue Feb 9, 2018 · 4 comments
Assignees
Labels

Comments

@rakewell
Copy link

rakewell commented Feb 9, 2018

This is happening on the following line:

Dim getOrders = Me.m_BinanceApi.GetOpenOrdersAsync(Me.m_BinanceUser)

m_BinanceUser is instantiated with (don't think I needed to create an instance of ApiRateLimiter in this release but I tried anyway):

    Private Sub InitBinanceAccountUser()
        Me.m_BinanceUser = New BinanceApiUser(pubKey, privKey, New ApiRateLimiter)
    End Sub

{"RateLimiter.DelayAsync count must not be less than 1." & vbCrLf & "Parameter name: count"}
Data: {System.Collections.ListDictionaryInternal}
HResult: -2147024809
HelpLink: Nothing
InnerException: Nothing
Message: "RateLimiter.DelayAsync count must not be less than 1." & vbCrLf & "Parameter name: count"
ParamName: "count"
Source: "Binance"
StackTrace: " at Binance.Api.RateLimiter.d__12.MoveNext() in D:\Dev\Internal\MessageStick.MessStockBot\StockDataManager.Dependencies\BinanceApi\Binance-0.2.0-alpha29\Api\RateLimit\RateLimiter.cs:line 65" & vbCrLf & "--- End of stack trace from previous location where exception was thrown ---" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)" & vbCrLf & " at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()" & vbCrLf & " at Binance.Api.ApiRateLimiter.d__10.MoveNext() in D:\Dev\Internal\MessageStick.MessStockBot\StockDataManager.Dependencies\BinanceApi\Binance-0.2.0-alpha29\Api\RateLimit\ApiRateLimiter.cs:line 98" & vbCrLf & "--- End of stack trace from previous location where exception was thrown ---" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tas
k task)" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)" & vbCrLf & " at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()" & vbCrLf & " at Binance.Api.BinanceHttpClientExtensions.d__17.MoveNext() in D:\Dev\Internal\MessageStick.MessStockBot\StockDataManager.Dependencies\BinanceApi\Binance-0.2.0-alpha29\Extensions\BinanceHttpClientExtensions.cs:line 642" & vbCrLf & "--- End of stack trace from previous location where exception was thrown ---" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)" & vbCrLf & " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)" & vbCrLf & " at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()" & vbCrLf & " at Binance.Api.BinanceApi.d__42.MoveNext() in D:\Dev\Internal\MessageStick.MessStockBot\StockDa
taManager.Dependencies\BinanceApi\Binance-0.2.0-alpha29\Api\BinanceApi.cs:line 600"
TargetSite: {Void MoveNext()}

@sonvister sonvister self-assigned this Feb 9, 2018
@sonvister sonvister added the bug label Feb 9, 2018
@sonvister
Copy link
Owner

sonvister commented Feb 9, 2018

@rakewell, thanks for mentioning. That method as well as Get24HourStatisticsAsync use the number of 'trading' symbols to compute the rate limit weight. I suspect that number was 0 at the time and caused the exception. Trading is active again and these methods should not fail now, but I will fix that issue and have it in the next release.

@sonvister
Copy link
Owner

@rakewell, the methods rely on the Symbol cache that is currently initialized with 0 symbols trading (status at the time of the build). So, the methods will still fail unless the Symbol cache is updated.

To update the cache: Symbol.UpdateCacheAsync(<IBinanceApi>)

@sonvister
Copy link
Owner

The fix has been released in 0.2.0-alpha30.

@rakewell
Copy link
Author

rakewell commented Feb 9, 2018

awesome, thanks @sonvister no error in the alpha30 release.

sonvister added a commit that referenced this issue Feb 23, 2018
Fix methods that use the number of trading symbols to determine rate limit weight. Update static assets and symbols. Fixes #54.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants