Closed martin-starosta closed 7 years ago
I am thinking about a process like this (for market orders, not limit): 1) insert the order, with a user reference id 2) wait 5 or 10 seconds, to give time to fill the order 3) download closed orders: if it's present and closed without error -> resolve() 4) wait a second 5) download open orders: if it's present and without errors just go back to point 2 6) the order has not been received from kraken, so we need to reinsert it. go back to point 1, (strange, but i think it could happen) maybe using the same user reference id and i hope this prevents duplication (this need to be tested)
to solve the timeout problem i've found this: https://github.com/nothingisdead/npm-kraken-api/pull/28/commits/ca939e6dd6c6cd9d3ca9a6ee52dc2170a8d25978 the KrakenClient can be created with an options parameter to configure the maximum timeout. The default is 5 seconds, maybe raising it to 30 or even more should solve the problem. When the library gives timeout the request still could be received from kraken, leading to the risk of placing duplicate orders.
Thank you! I will try to increase timeout and we will see what will happen.
Timeout can be configured with .env
Kraken respond many times with "TIMEOUT" error. Need to handle better.