ExchangeUnion / market-maker-bot

MM Bot for OpenDEX. Make profits via arbitrage between OpenDEX and a connected CEX account like Binance 🤖
GNU Affero General Public License v3.0
105 stars 20 forks source link

arby stops it's work when price feed was lost and all orders were cancelled, doesn't retry #56

Closed kilrau closed 3 years ago

kilrau commented 3 years ago

Today I realized that arby had stopped working because the price feed was temporarily lost. After correctly cancelling OpenDEX orders and retrying until exchange orders were cancelled too it stopped. Arby should retry connecting to the price stream and start issuing orders again once it's back.

2020-07-24 01:49:03.033 [Centralized] warn: Price feed lost. Retrying in 5000ms.
2020-07-24 01:49:03.033 [Centralized] trace: ETHBTC stream closed
2020-07-24 01:49:03.033 [OpenDEX] info: All OpenDEX orders have been removed
2020-07-24 01:49:13.1313 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598543619&recvWindow=5000&symbol=ETHBTC&signature=767184b59082db3a9c6f7cabb0de0de92eab113e96c074d2f550352e23e1ad4b request timed out (10000 ms) - retrying in 1000ms
2020-07-24 01:49:19.1919 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598554625&recvWindow=5000&symbol=ETHBTC&signature=b76465bf3bbf4999ed885586a216a084b0fef547e0a952606e724f774f59201d system request to https://api.binance.com/api/v3/openOrders?timestamp=1595598554625&recvWindow=5000&symbol=ETHBTC&signature=b76465bf3bbf4999ed885586a216a084b0fef547e0a952606e724f774f59201d failed, reason: getaddrinfo EAI_AGAIN api.binance.com - retrying in 1000ms
2020-07-24 01:49:25.2525 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598560640&recvWindow=5000&symbol=ETHBTC&signature=e01e245b48ea478f9a6451e3569c0acf2c9615a623399fe9a43da0815a249e7b system request to https://api.binance.com/api/v3/openOrders?timestamp=1595598560640&recvWindow=5000&symbol=ETHBTC&signature=e01e245b48ea478f9a6451e3569c0acf2c9615a623399fe9a43da0815a249e7b failed, reason: getaddrinfo EAI_AGAIN api.binance.com - retrying in 1000ms
2020-07-24 01:49:31.3131 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598566649&recvWindow=5000&symbol=ETHBTC&signature=6c0cc879dfd92bb73ddd8628ad8bcc0fc641fd62768db5a1f5bb4183f7e876e3 system request to https://api.binance.com/api/v3/openOrders?timestamp=1595598566649&recvWindow=5000&symbol=ETHBTC&signature=6c0cc879dfd92bb73ddd8628ad8bcc0fc641fd62768db5a1f5bb4183f7e876e3 failed, reason: getaddrinfo EAI_AGAIN api.binance.com - retrying in 1000ms
2020-07-24 01:49:37.3737 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598572660&recvWindow=5000&symbol=ETHBTC&signature=3391e03728d5bedb081cdbebae3aa1e7fdfd01e360f5ce43cd30c427410dd1e8 system request to https://api.binance.com/api/v3/openOrders?timestamp=1595598572660&recvWindow=5000&symbol=ETHBTC&signature=3391e03728d5bedb081cdbebae3aa1e7fdfd01e360f5ce43cd30c427410dd1e8 failed, reason: getaddrinfo EAI_AGAIN api.binance.com - retrying in 1000ms
2020-07-24 01:49:43.4343 [Centralized] warn: Failed to remove orders: binance GET https://api.binance.com/api/v3/openOrders?timestamp=1595598578670&recvWindow=5000&symbol=ETHBTC&signature=1ae500c7dbe2df42611f73a4da611e629048b756c621a34302839c15b769b222 system request to https://api.binance.com/api/v3/openOrders?timestamp=1595598578670&recvWindow=5000&symbol=ETHBTC&signature=1ae500c7dbe2df42611f73a4da611e629048b756c621a34302839c15b769b222 failed, reason: getaddrinfo EAI_AGAIN api.binance.com - retrying in 1000ms
2020-07-24 01:49:47.4747 [Centralized] info: All CEX orders have been removed
kilrau commented 3 years ago

I can reliably reproduce this on my instances if you can't.

kilrau commented 3 years ago

I only see this on mainnet.

kilrau commented 3 years ago

Mystery solved: arby mainnet is still on the 0.2.0 tag (f40edbcc1b928bdae3bf80b23f8cdbe0d3e8712e), that does not contain the price feed fix. PR tagging 1.0.0 and updating xud-docker coming up.