bmino / binance-triangle-arbitrage

Detect in-market cryptocurrency arbitrage
MIT License
1.07k stars 336 forks source link

Timestamp for this request was 1000ms ahead of the server's time. #118

Closed Izem0 closed 3 years ago

Izem0 commented 3 years ago

Hello! I do not know anything about javascript therefore please be comprehensive.

When I run the program from my windows terminal with "EXECUTION.ENABLED": false, everything works perfectly, the table with the prices and arbitrage possibilities display and refresh.

The problem comes when I turn "EXECUTION.ENABLED" to 'true'; I get a long display that ends like this :

  toJSON: [Function: responseToJSON],
  caseless: Caseless {
    dict: {
      'content-type': 'application/json;charset=UTF-8',
      'content-length': '88',
      connection: 'close',
      date: 'Sun, 01 Nov 2020 20:11:23 GMT',
      server: 'nginx',
      'x-mbx-uuid': '1d885788-c375-4348-adec-3fcbc2560206',
      'x-mbx-used-weight': '11',
      'x-mbx-used-weight-1m': '11',
      'strict-transport-security': 'max-age=31536000; includeSubdomains',
      'x-frame-options': 'SAMEORIGIN',
      'x-xss-protection': '1; mode=block',
      'x-content-type-options': 'nosniff',
      'content-security-policy': "default-src 'self'",
      'x-content-security-policy': "default-src 'self'",
      'x-webkit-csp': "default-src 'self'",
      'cache-control': 'no-cache, no-store, must-revalidate',
      pragma: 'no-cache',
      expires: '0',
      'x-cache': 'Error from cloudfront',
      via: '1.1 b9a91b9002d4fb924a73a6172edb4dc8.cloudfront.net (CloudFront)',
      'x-amz-cf-pop': 'CDG3-C1',
      'x-amz-cf-id': 'VkI3A9BHd-N8uOiV287YcParBj2rI2USIKvve4fSP-uzqlK-zKADNg=='
    }
  },
  body: `{"code":-1021,"msg":"Timestamp for this request was 1000ms ahead of the server's time."}`,
  [Symbol(kCapture)]: false,
  [Symbol(RequestTimeout)]: undefined
}

I uploaded my config.json (as a txt file) if it can help. config.json.txt

Some help would be highly appreciated! Thank you for your efforts!

Izem0

bmino commented 3 years ago

Hey! Thanks for your interest in the project!

I've seen this issue pop up a few times before. It usually stems from your system clock not being properly synced. Which operating system are you using?

Izem0 commented 3 years ago

Thanks for your quick answer. I run python 3 under Windows 10.

bmino commented 3 years ago

Okay great! Nothing in this bot uses python, but your system time is used when building requests. You can sync this via steps such as: https://www.windowscentral.com/how-manage-time-servers-windows-10

Izem0 commented 3 years ago

Oh yeah, actually I'm using my windows terminal to run the program, sorry for the mistake. I tried to change my time server from time.windows.com to time.nist.gov and it actually works! Thanks

I got a last question, what max investment do you suggest me ? Because my max is set to 0.015 BTC but it throw me this error:

Error: Only detected 6e-7 BTC, but 0.015 BTC is required to satisfy INVESTMENT.MAX configuration.

Thanks

bmino commented 3 years ago

I believe that check is looking at how much BTC you have on the exchange.

You need to have BTC on the exchange equal (or greater) to your INVESTMENT.MAX So you can either increase the amount of BTC on the exchange, or reduce your INVESTMENT.MAX

Izem0 commented 3 years ago

Ok thank you very much! See you