Zenbot: CEXIO getTrades() returned duplicate results

Created on 18 Oct 2017  路  8Comments  路  Source: DeviaVir/zenbot

Hello,

I'm trying to use CEX.IO but am met with an error. I've looked around and noticed another exchange was fixed by changing it from 2 hours to 12. Any idea why this error would happen? It seems even after wiping the collection and trying again it still fails at the same spot.

fetching pre-roll data:

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 750 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }
               DATE            PRICE     DIFF            VOL         RSI                         ACTIONS                      BAL                PROFIT
2017-10-17 21:00:00  5621.85 BTC-USD                3
2017-10-17 21:30:00  5587.00 BTC-USD   -0.62%       48
2017-10-17 22:00:00  5580.00 BTC-USD   -0.13%       16
2017-10-17 22:30:00  5589.96 BTC-USD   +0.18%       44
---------------------------- STARTING LIVE TRADING ----------------------------
Press  l  to list available commands.
/home/hype/zenbot/extensions/exchanges/cexio/exchange.js:77
        balance.currency = n(body[opts.currency].available).format('0.00000000')
                                                 ^

TypeError: Cannot read property 'available' of undefined
    at /home/xxx/zenbot/extensions/exchanges/cexio/exchange.js:77:43
    at Request.request [as _callback] (/home/xxx/zenbot/node_modules/cexio-api-node/rest.js:67:16)
    at Request.self.callback (/home/xxx/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/xxx/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/xxx/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1057:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Most helpful comment

The problem is not linked with error: Rate limit exceeded message.
I got the same error on the same trade 376024.

root@fa4488802bab:/app# node zenbot.js backfill cexio.BTC-USD

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 757 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }

Can someone reopen the issue plz ? @DeviaVir ?

All 8 comments

Hello, I'm aware of this issue and have fix for it. Will prepare PR, but DeviaVir is on vacation, so I'm testing for more bugs.
Quick fix at #75 change to:
if (err || typeof body === 'undefined' || body === 'error: Nonce must be incremented') return retry('getBalance', func_args, err)

@nedievas Didn't seem to fix it.

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 750 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }
               DATE            PRICE     DIFF            VOL         RSI                         ACTIONS                      BAL                PROFIT
2017-10-17 21:00:00  5621.85 BTC-USD                3
2017-10-17 21:30:00  5587.00 BTC-USD   -0.62%       48
2017-10-17 22:00:00  5580.00 BTC-USD   -0.13%       16
2017-10-17 22:30:00  5589.96 BTC-USD   +0.18%       44
---------------------------- STARTING LIVE TRADING ----------------------------
Press  l  to list available commands.
/home/hype/zenbot/extensions/exchanges/cexio/exchange.js:78
        balance.currency = n(body[opts.currency].available).format('0.00000000')

Note The line is moved down one due to a comment I added.

Check if cexio-api-node module is 1.0.4 version

avery@vps130953:/home/hype/zenbot$ npm view cexio-api-node version
1.0.4

I updated the file and am getting this error.

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 751 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }
               DATE            PRICE     DIFF            VOL         RSI                         ACTIONS                      BAL                PROFIT
2017-10-17 21:00:00  5621.85 BTC-USD                3
2017-10-17 21:30:00  5587.00 BTC-USD   -0.62%       48
2017-10-17 22:00:00  5580.00 BTC-USD   -0.13%       16
2017-10-17 22:30:00  5589.96 BTC-USD   +0.18%       44
---------------------------- STARTING LIVE TRADING ----------------------------
Press  l  to list available commands.
/home/hype/zenbot/extensions/exchanges/cexio/exchange.js:79
        balance.currency = n(body[opts.currency].available).add(body[opts.currency].orders).format('0.00000000')
                                                 ^

TypeError: Cannot read property 'available' of undefined
    at /home/hype/zenbot/extensions/exchanges/cexio/exchange.js:79:50
    at Request.request [as _callback] (/home/hype/zenbot/node_modules/cexio-api-node/rest.js:67:16)
    at Request.self.callback (/home/hype/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/hype/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/hype/zenbot/node_modules/cexio-api-node/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1057:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Running backfill throws this error

avery@vps130953:/home/hype/zenbot$ sudo ./zenbot.sh backfill cexio.BTC-USD

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 751 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }

Looking into it. It backfills to much data. I get error: Rate limit exceeded on BTC-EUR.

Should be OK now. #644

The problem is not linked with error: Rate limit exceeded message.
I got the same error on the same trade 376024.

root@fa4488802bab:/app# node zenbot.js backfill cexio.BTC-USD

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 757 days left
.
error: getTrades() returned duplicate results
{ product_id: 'BTC-USD', from: 376024 }
{ product_id: 'BTC-USD', from: 376024 }

Can someone reopen the issue plz ? @DeviaVir ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

njannink picture njannink  路  4Comments

timstoop picture timstoop  路  4Comments

joeswann picture joeswann  路  4Comments

DeviaVir picture DeviaVir  路  3Comments

ituhin picture ituhin  路  3Comments