0

I am becoming extremely frustrated with the nonce issue on the Kraken private HTTP API.

I frequently get EAPI:Invalid nonce errors. The support is sketchy in this area: it could mean the nonce is not in sequence, or it could mean that there are too many simultaneous requests (which might give rise to the first scenario).

Other than completely ripping out my Axios HTTP implementation and rewriting the entire thing, I am at a loss as to what to do. I have visited this link:

https://support.kraken.com/hc/en-us/articles/360001148063-Why-am-I-getting-invalid-nonce-errors-

I have:

  • Created a new API key to reset the nonce
  • Increased the nonce window to 10000ms
  • Written code to increase the nonce resolution

I have also:

  • Throttled requests to the API, ensuring nonces come in sequence
  • Written code to retry the request up to 3 times in the event of a nonce error, with a delay of 1s

I am at a loss as to what to do. I am only using one set of API credentials, since the requests come from different places and creating multiple API keys is not going to mitigate this issue. I have no way of choosing between keys really, and I will still encounter this issue.

Suggestions? I cannot imagine I am the first client to have encountered this problem. Throttling is very difficult, because it cannot be guaranteed that the requests will then appear in sequence and so the nonce error will just be moved from one place to another.

serlingpa
  • 12,024
  • 24
  • 80
  • 130

1 Answers1

0

I was having the same problem, what I realized is that my post parameters were in the wrong order. They must be in exactly the order listed in the docs, otherwise the request will throw an "invalid nonce" error even if your nonce is formatted correctly.

I also noticed that there is no mention of how to order the request data in the docs, so it is an easy mistake to make. Also, none of the support docs mentions that this kind of improper formatting might throw this error. Hope this helps!

Hasselhoff
  • 33
  • 5