Open gaia opened 6 years ago
@gaia
Your return result is an object when data.result
is looking for an array. For this arbitrage system, you should point to the endpoint that supplies an array of data for all of the pairs, not just one single pair.
Also, once you get the right return type, you will need to modify the way the iteration is taking place in the for
loop, since most likely, they will have their own property names.
i will build a custom parser and have the system call my parser instead of the API directly. thank you rey.
I added a market
Which returns for https://market.net/api/ticker/adt_eth
{"adt_eth":{"high":0.00022014,"low":0.00022014,"avg":0.00022014,"vol":0,"vol_cur":0,"last":0.00022014,"buy":0.00002016,"sell":0.00040400,"updated":1514361578},
but when i run the bot i get
TypeError: data.result is not iterable at /root/arb/settings.js:101:42 at new Promise ()
at Object.last (/root/arb/settings.js:99:20)
at Request._callback (/root/arb/main.js:51:49)
at Request.self.callback (/root/arb/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/root/arb/node_modules/request/request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/root/arb/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
the return result is valid JSON. how do i process the API call result to make it digestible?