Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EUR lending not working in Bitfinex #589

Open
tuberculo opened this issue Dec 5, 2017 · 8 comments
Open

EUR lending not working in Bitfinex #589

tuberculo opened this issue Dec 5, 2017 · 8 comments

Comments

@tuberculo
Copy link
Contributor

tuberculo commented Dec 5, 2017

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
Copy link
Contributor Author

tuberculo commented Dec 10, 2017

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
Copy link
Contributor Author

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)

rnevet pushed a commit that referenced this issue Dec 13, 2017
@tuberculo
Copy link
Contributor Author

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
Copy link

Same issue here :
image

@JCBauza
Copy link
Contributor

JCBauza commented Jan 19, 2018

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
Copy link

Sigri44 commented Jul 1, 2018

Same issue !

@tuberculo
Copy link
Contributor Author

Workaround:
Set in separate coin section

[EUR]
minloansize = 45 

@Sigri44
Copy link

Sigri44 commented Jul 8, 2018

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

Evanito pushed a commit that referenced this issue Jul 20, 2018
* merge upstream (#1)

* Plugin Graphs: make history file configurable (#518)

* make history file configurable

* removed extra paren

* Reduce chances of nonce collisions (#520)

* Check currency is being analysed before trying to get a rate for it (#528)

* Check currency is being analysed before trying to get a rate for it

* Fix Capital C in "Lending.py", line 85 (#529)

* Resolves Issue 526 (#533)

* add dashboard link in navbar
* aggregate correct column

* Fix recorded data when no rate offers exist, don't print traceback unless ma_debug is on (#531)

* Return a dict of all currencies even if balance is 0 (#540)

* Log bot "version" on error handling (#543)

* When logging an exception also log the number of commits on current branch, will allow to easily identify if reporter is on master and updated.

* Move get_git_version to Data module

* Change fallback version number to 3.0.0

* A safer approach for handling errors in the git call

* Html response fix (#546)

* prevent exception overloading when receiving an html response error

* prevent unicode from throwing an exception

* File log using ensure_ascii

* Change min/max daily lend rate depending on exchange (and simplify xdays) (#547)

* Change min/max daily lend rate depending on exchange

* Lending.py

Simplify code with xdays and max/min daily rate

* Update Lending.py

* Update Lending.py

* Bitfinex sync fix (#555)

* Sync Bitfinex API requests completely

* Update test

* Update test

* ERR_RATE_LIMIT_fix (#549)

* Return a dict of all currencies even if balance is 0

* Sleep and reduce requests per min if we get ERR_RATE_LIMIT

* Reduce request window to 1 sec

* Move the timers to millisecond resolution in the coach, MA changes times now when it catches 429

* Comments, logs, fix exception

* Don't change api request times unless using bitfinex

* Update polo coach to milliseconds

* Catch 429 at top level and more sensible api_req_period calc

* PEP-8

* Unrelated bug I found from ERR_RATE_LIMIT_fix

* Sync Bitfinex API requests completely

* Update test

* Update test

* Messed up the merge from bitfinex_sync_fix

* Move timer change methods to base class and catch 429 at API level

* Add poloniex timer changes

* Make sure to re-raise the error, sleep in the MA module not the API.

* Converted a tab to spaces

* Added Blacklist Option & enforce whitelist (#570)

* Added Blacklist Option for Lending

* Mistake in Configuration.py

* Optimized config description

* Optimized description

* Minimized api requests by using blacklist_currencies and all_currencies parameter

* Removed BTG from all_currencies

* Changed to more simple blacklist and changed documentation

* Changed default config

* Changed configuration description

* Addition of a Slack Username parameter as a configuration option. (#576)

* Addition of a Slack Username parameter as a configuration option.

* Backward compatibility for configs which lack a slack_username

* split multiline message into multiple irc messages (#582)

the irc lib in use doesn't support sending multiline messages. this patch splits messages containing newline characters into multiple irc messgaes to resolve issue: #565

* Discover minimum amount in EUR (#594)

I think this solves #589.

* Use docker image with pandas and numpy already installed (#593)

* Fixes absolute reference

This way the webpage will work even if under a directory, otherwise it redirects to the root directory.

* Use FRR on bitfinex as min_daily_rate (#554)

* Return a dict of all currencies even if balance is 0

* Sleep and reduce requests per min if we get ERR_RATE_LIMIT

* Reduce request window to 1 sec

* Move the timers to millisecond resolution in the coach, MA changes times now when it catches 429

* Comments, logs, fix exception

* Don't change api request times unless using bitfinex

* Update polo coach to milliseconds

* Catch 429 at top level and more sensible api_req_period calc

* Use FRR for min_daily_rate

* Missing from last commit

* PEP-8

* Config and docs for frr as min

* Use config for frr and use configured min if higher

* Unrelated bug I found from ERR_RATE_LIMIT_fix

* Unrelated bug I found from ERR_RATE_LIMIT_fix

* Sync Bitfinex API requests completely

* Update test

* Update test

* Messed up the merge from bitfinex_sync_fix

* Messed up the merge from bitfinex_sync_fix

* Move timer change methods to base class and catch 429 at API level

* Add poloniex timer changes

* Make sure to re-raise the error, sleep in the MA module not the API.

* Converted a tab to spaces

* Added FRR Delta for Bitfinex

* Added FRR Delta for Bitfinex

* PEP-8

* Log when using FRR as min daily rate

* Allow config to be picked up from 'BOT' section rather than just coin_cfg

* Declare variables to allow global access

* This is why we should use classes!

* exchangeMax needs defined

* add larger sleeps to prevent API bans

* only display active coins in charts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants