-
Notifications
You must be signed in to change notification settings - Fork 19
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
kraken.exceptions.KrakenException.KrakenInvalidNonceError: An invalid nonce was supplied. #114
Comments
According to the commit you provided, this is where the nonce is calculated: python-kraken-sdk/kraken/base_api/__init__.py Lines 199 to 200 in 1fce745
Indeed, the nonce is always API key independent and must be the highest ever sent for this key. I'm running several deployments using different API keys and did not experienced any nonce related errors, these were only a problem in a very early version of this tool. You can check the behaviour by running multiple instances using different and some with the same API keys and access endpoints that need authentication. Only those with the same key that are executed in nearly the same time but with some internal delay could lead to this error. |
That looks to me to just be millisecond accuracy. Maybe two calls are happening within 1ms and getting the same nonce? I remember from some earlier projects that ms accuracy wasn't enough for my logging, I needed microsecond accuracy to not have re-use of timestamps. |
Do you have any concerns about using *1000000 instead of *1000? |
I increased the accuracy of the nonce calculation for Spot and Futures in https://github.com/btschwertfeger/python-kraken-sdk/pull/106)](https://github.com/btschwertfeger/python-kraken-sdk/pull/106. This will be included in the upcoming release (milestone/7). |
Thanks so much! :) I appreciate how well you're managing this project. You really seem on top of things. :) |
I'm getting InvalidNonceErrors when I'm calling Trade().create_order().
I am running a single thread, single process for this API key. I have another process using a different API key but they should be independent.
The sdk code I'm using is based off of 1fce745. I'm not sure if the nonce logic has changed since then or not.
Could there be an issue with the nonce logic? Are you using system time to the microsecond?
The text was updated successfully, but these errors were encountered: