Skip to content

Implement a proper time server bias calculation #2

@DavidHuertas

Description

@DavidHuertas

Main problem:
To the Coinbase Pro API exchange there are public and private calls. The second ones must be signed applying the secret key to a composed-string (see the Coinbase Pro API documentation here). This composed-string includes the current timestamp in UNIX EPOCH seconds, and if you send the call with more than 30 seconds of difference from the Coinbase Pro time server, the call response will be the following http status 400 error:

{"message": "request timestamp expired"}

Unfortunately right now the Coinbase Pro time server is around 80 seconds ahead of the universal UNIX EPOCH instant. You can check this by calling the Coinbase Pro public service "/time".

Current temporary solution:
To make the Coinbase Pro Exchange Adapter work, it was implemented a temporary solution: add this "time-server-bias" as a property in the "otherConfig" section of "engine.yaml" properties file. When the Exchange Adapter config is initialized, this bias is added as an Exchange Adapter property, so everytime the unix epoch in seconds is asked, the bias is added.

Proper solution:
That solution should be override changing this "bias" property in the engine.yaml file by a call to the "/time" service once at the beginning, and maybe another after a "request timestamp expired" error (this second option would be great supposing a Coinbase Pro server hot fix of this problem).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions