BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 345 forks source link

EUR lending not working in Bitfinex #589

Open tuberculo opened 6 years ago

tuberculo commented 6 years ago

Bot fails to lend EUR in Bitfinex. It shows the following error in the log: Error USD_EUR.

I added EUR in the currencies list in default.cfg. I also modified line 33 in Bitfinex.py, as @rnevet sugested.

[BITFINEX]
# Full list of supported currencies
all_currencies = USD,BTC,BCH,ETH,XRP,IOT,XMR,LTC,OMG,ETC,EOS,DSH,ZEC,EUR
    self.baseCurrencies = ['USD', 'BTC', 'ETH', 'EUR']
Traceback (most recent call last):
  File "lendingbot.py", line 94, in <module>
    Lending.lend_all()
  File "/home/xxxx/bots/bitfinex/poloniexlendingbot/modules/Lending.py", line 247, in lend_all
    usable_currencies += lend_cur(cur, total_lent, lending_balances, ticker)
  File "/home/xxxx/bots/bitfinex/poloniexlendingbot/modules/Lending.py", line 444, in lend_cur
    raise msg
KeyError: u'USD_EUR'

v312
 Unhandled error, please open a Github issue so we can fix it!
tuberculo commented 6 years ago

Lending EUR seems to be working now. But the message Error USD_EUR still shows up every time.

Edit: It is not working again.

tuberculo commented 6 years ago

Maybe this would solve the issue: In Bitfinex.py, change from (lines 273 - 282)

        except Exception as e:
                msg = str(e)
                # "Invalid offer: incorrect amount, minimum is 50 dollar or equivalent in USD"
                if "Invalid offer: incorrect amount, minimum is 50" in msg:
                    usd_min = 50
                    cur_min = usd_min
                    if currency != 'USD':
                        cur_min = usd_min / float(self.return_ticker()['USD_' + currency]['lowestAsk'])

                    raise Exception("Error create_loan_offer: Amount must be at least " + str(cur_min) + " " + currency)

to

        except Exception as e:
                msg = str(e)
                # "Invalid offer: incorrect amount, minimum is 50 dollar or equivalent in USD"
                if "Invalid offer: incorrect amount, minimum is 50" in msg:
                    usd_min = 50
                    cur_min = usd_min
                    if currency != 'USD':
                        if currency = 'EUR':
                             cur_min = usd_min / float(self.return_ticker()['USD_' + 'BTC']['lowestAsk']) * float(self.return_ticker()['BTC_' + 'EUR']['lowestAsk'])
                       else:
                        cur_min = usd_min / float(self.return_ticker()['USD_' + currency]['lowestAsk'])

                    raise Exception("Error create_loan_offer: Amount must be at least " + str(cur_min) + " " + currency)
tuberculo commented 6 years ago

Something is still wrong. It is lending euro most of the time, but sometimes it doesn't. And I get this error message now Error EUR_BTC. It also does not show how much an EUR worth in the webserver.

marczeller commented 6 years ago

Same issue here : image

JCBauza commented 6 years ago

I have the same issue but EUR_BTC. Need the logic to name it the other way around?

2018-01-19 00:57:26 Error EUR_BTC Traceback (most recent call last): File "lendingbot.py", line 94, in Lending.lend_all() File "/poloniexlendingbot/modules/Lending.py", line 247, in lend_all usable_currencies += lend_cur(cur, total_lent, lending_balances, ticker) File "/poloniexlendingbot/modules/Lending.py", line 444, in lend_cur raise msg KeyError: 'EUR_BTC'

v315 Unhandled error, please open a Github issue so we can fix it!

Sigri44 commented 6 years ago

Same issue !

tuberculo commented 6 years ago

Workaround: Set in separate coin section

[EUR]
minloansize = 45 
Sigri44 commented 6 years ago

getJSON failed, status: parsererror, error: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Only on Bitfinex, Poloniex work fine