semashkinvg / Bitmex.NET

Wrapper for BitMEX.com REST & WebSocket API
MIT License
52 stars 26 forks source link

Nonce is too large #6

Closed tekr closed 6 years ago

tekr commented 6 years ago

Bitmex has begun rejecting requests sent using Bitmex.NET with the following error:

System.AggregateException: One or more errors occurred. (Nonce must be a valid number and below 2^53. You sent: 9007402207710664., Code:HTTPError) ---> Bitmex.NET.BitmexApiException: Nonce must be a valid number and below 2^53. You sent: 9007402207710664., Code:HTTPError at Bitmex.NET.BitmexApiProxy.d__7.MoveNext()

Evidently there is a nonce upper limit of 2^53. Using the formula in NonceProvider.GetNonce():

new DateTime(1990, 1, 1).AddTicks((long)Math.Pow(2, 53)) = 17/7/2018 11:58:45pm

i.e. as of just before midnight last night, generated nonce values are too large.

tekr commented 6 years ago

Closing as it was fixed in commit 4e0c4b343791a06ca7253970510e2b02bf1f673f.