MikaLendingBot
MikaLendingBot copied to clipboard
Plugin AccountStats / Charts - Inaccurate data for Poloniex (API Issue)
Poloniex doesn't return complete data when using their API. I've opened several tickets with them. You can test this yourself by calling 'returnLendingHistory' for date X thru Y and do the same in poloniex.com/tradeHistory (change type to Lending Earnings). You'll see stark differences between the two.
Because of this, charts and accountstats plugins will show inaccurate data.
Not sure how to get accurate data.
The only idea I had was since Polo loans have IDs is to do different overlapping repeated requests till you don't get any new ids.
Hrm. I haven't tested that. Will give it a shot. Repeated API calls with the same dates gives same missing results.
As an FYI, Bittrex is spot on. If you manually download the CSV from their web UI and compare to what is in the SQLite db, it's the same data.
I assumed this was a Poloniex issue... :( The entire code is over complicated because of the weird responses.
As i understand - i have the same issue. If delete DB and restart poloniex - first stats is ok. But when you fetch data next time it show strange values. As example - mean day earnings 10000 satoshi, but it show something like: 0.00000608 BTC Today 0.0000139 BTC Yesterday But if i will delete DB and restart bot, for the first time it will show actual values.
@utdrmac last attempt, I'm assuming we are using the fetch history wrong and the start&end dates behavior is somehow effecting not only the close date but also the open dates.
I'm testing the following:
def fetch_history(self, first_time_stamp, last_time_stamp):
first_time_stamp = first_time_stamp - 172800
Basically add a 2 day offset to the start to catch. (this won't catch longer loans)
If this improves the results I need to re-think the way we perform the syncing of loans.
@rnevet Saw your slack. So you think the API is for open dates rather than closing?
@utdrmac I'm not sure but it seems much more accurate with this patch.
Can we close this @utdrmac / @rnevet ?
No,. The issue is still there.