tiagosiebler / TriangularArbitrage

Detect triangular arbitrage opportunities within Binance price tickers
566 stars 174 forks source link

Error #57

Closed ghost closed 5 years ago

ghost commented 5 years ago

/root/TriangularArbitrage/lib/PairRanker.js:27 while (!check && k < 5 && candidates[0].rate > parseFloat(process.env.minimalProfit)) { ^

TriangularArbitrage@0.2.0 start /root/TriangularArbitrage TypeError: Cannot read property 'rate' of undefined at PairRanker.getPairRanking (/root/TriangularArbitrage/lib/PairRanker.js:27:43) at Object.ctrl.storage.streamTick (/root/TriangularArbitrage/lib/BotCore.js:18:41) at CurrencyCore.events.onAllTickerStream.stream (/root/TriangularArbitrage/lib/CurrencyCore.js:324:24) at WebSocket.ws.on (/root/TriangularArbitrage/node_modules/binance/lib/ws.js:21:13) at emitOne (events.js:116:13) at WebSocket.emit (events.js:211:7) at Receiver._receiver.onmessage (/root/TriangularArbitrage/node_modules/ws/lib/WebSocket.js:141:47) at Receiver.dataMessage (/root/TriangularArbitrage/node_modules/ws/lib/Receiver.js:389:14) at perMessageDeflate.decompress (/root/TriangularArbitrage/node_modules/ws/lib/Receiver.js:349:40) at _decompress (/root/TriangularArbitrage/node_modules/ws/lib/PerMessageDeflate.js:306:9) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! TriangularArbitrage@0.2.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the TriangularArbitrage@0.2.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-12-23T14_15_09_384Z-debug.log

ghost commented 5 years ago

——- IMPORTANT NOTE ——- I have never encountered the issue with the default conf.ini file.

tiagosiebler commented 5 years ago

This logic looks at all possible arbitrage ABC routes and filters them based on a minimum profit threshold. If candidates[0].rate is undefined, the logic realistically shouldn't run. Should be easy to add a && candidates.length condition at the start of the while conditions.

tiagosiebler commented 5 years ago

Same issue as #55.