BenjiLee/PoloniexAnalyzer

return_lending_history() does not return the full history

Closed this issue · 2 comments

As shown here:

> python3 ./poloniex.py -a GetLendingHistory
[TerminalIPythonApp] WARNING | File not found: '/home/dog/.pythonstartup'
> /home/dog/PoloniexAnalyzer/poloniex_apis/trading_api.py(76)return_lending_history()
     75     import ipdb; ipdb.set_trace()
---> 76     return _call_trading_api(body)
     77                                                          
                                                                                                                                                                                                                                                                                
ipdb> x = _call_trading_api(body)
ipdb> x[0]
{'open': '2017-05-30 08:46:33', 'earned': '0.00000030', 'fee': '-0.00000005', 'amount': '0.00091053', 'interest': '0.00000035', 'duration': '0.34900000', 'currency': 'BTC', 'rate': '0.00109000', 'id': 357339895, 'close': '2017-05-30 17:09:04'}
ipdb> x[-1]
{'open': '2017-05-24 16:11:38', 'earned': '0.00014485', 'fee': '-0.00002556', 'amount': '0.05688144', 'interest': '0.00017041', 'duration': '2.00130000', 'currency': 'BTC', 'rate': '0.00149700', 'id': 353726581, 'close': '2017-05-26 16:13:29'}
ipdb>

You need to loop as they don't send you all the data in one go.

Example here:

https://github.com/BitBotFactory/poloniexlendingbot/blob/master/plugins/AccountStats.py#L44

Thanks for the issue report! I'll check this out.

Hopefully resolved in #48

Let me know if you are still running into issues. I can't test this myself since I don't know how the API behaves and I don't have a long enough lending history.