cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
199 stars 78 forks source link

Consider pending deposits and withdrawals in Arbitrator::trade() #39

Open cryptoeax opened 6 years ago

cryptoeax commented 6 years ago

We can add code similar to matchTradesConsideringPendingDeposits() which would adjust the buy/sell amounts when there are pending deposits/withdrawals. It's probably better to do this after #37.

Scorpic1 commented 6 years ago

Still have problem, cyclic messages:

21:14:47: Checking LBC_BTC...
21:14:48: SPREAD : 0.00000175 BTC = 0.00003116 BTC PROFIT
21:14:48: [DB] Omitting track 22.38454641 LBC @ BITTREX as previous entry is too young
21:14:48: Testing if trading is profitable with available funds...
21:14:48: TRADING LBC-BTC FROM POLONIEX TO BITTREX

= FUNDS ============================================
     SOURCE :     0.00402346 BTC
     TARGET :   310.86332052 LBC

= SIMULATION =======================================
 TARGET MAX :   310.86332052
 SOURCE MAX :    22.38454641
   BUY RATE :     0.00006480
 BUY AMOUNT :    22.38454641
  BUY PRICE :     0.00145414
  SELL RATE :     0.00006655
SELL AMOUNT :    22.37454641
 SELL PRICE :     0.00148530
     PROFIT :     0.00003116

= TRADE ============================================
 SELL ORDER : 22.37454641 LBC @ 0.00006489 BTC
  BUY ORDER : 22.38454641 LBC @ 0.00006642 BTC

21:14:48: Placed sell order (BITTREX ID: 0e95f0da-949b-4b92-b168-dd7f81616881)
21:14:50: Placed buy order (POLONIEX ID: BTC_LBC:30144040952)
21:14:50: Waiting for order execution...
21:15:50: [BITTREX] Cancelling order 0e95f0da-949b-4b92-b168-dd7f81616881
21:15:50: [POLONIEX] Cancelling order BTC_LBC:30144040952
21:15:52: Checking trade results (1)...
21:15:58: Received 22.38454641 LBC from the exchange while our wallets show a balance difference of 22.32858505 (22.32858505 - 0.00000000 finished deposits)
21:16:02: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:02: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:03: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:03: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:05: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:05: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:10: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:10: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:11: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:11: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:14: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:14: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:18: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:18: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:22: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:22: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:23: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:23: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:25: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:25: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:26: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:26: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:28: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:28: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:30: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:30: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:31: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:31: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:32: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:32: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:33: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
21:16:33: WARNING: not reciving all sell trades from the exchange in time, waiting a bit and retrying...
21:16:35: Received 122.37454641 LBC from the exchange while our wallets show a balance difference of 22.37454641 (22.37454641 - 0.00000000 finished deposits)
cryptoeax commented 6 years ago

This wasn't an infinite loop, correct?

Scorpic1 commented 6 years ago

After get this message this is infinite loop. =( Make restart bot and it can work normally sometimes.

cryptoeax commented 6 years ago

What version of the bot are you running? Can you please run git rev-parse HEAD?

Scorpic1 commented 6 years ago

Sorry, i am use version without last updates.

cryptoeax commented 6 years ago

No problem, you scared me for a second. :-) This problem used to happen all the time, but it should never happen any more...