An EAPI:Invalid nonce error indicates that an API request was received with a repeated or lower than expected nonce value.
Since the nonce value must be unique and must increase with every request, you may run into errors when trying to make simultaneous requests, or requests in rapid succession, or when attempting to use a single API key for multiple devices/apps/bots.
As an example, two simultaneous API requests might not arrive in the intended order, and if the second request (with a higher nonce) arrives before the first request (with a lower nonce), the first request would be rejected when it finally arrives.
Note that frequent invalid nonce errors will ultimately cause your API requests to be temporarily locked out (for 15 minutes), hence invalid nonce errors should not simply be ignored.
Some potential solutions for invalid nonce errors are as follows:
- Create multiple API keys and use a different key for each simultaneous request, each device/app, each trading bot, etc. Each API key has its own separate nonce value, so the order in which API requests arrive would no longer be an issue.
- Increase the nonce resolution so as to allow additional requests during the same time frame (increasing the nonce resolution from milliseconds to tenths of milliseconds, for example).
- Increase/widen the nonce window for your API keys so as to provide a short time frame during which invalid nonce values would not cause an error. Note that this solution should only be used to overcome networking issues, not as a way to ignore invalid nonce errors entirely.