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

KeyError: 'LDBNB' #5

Closed
SaLuci opened this issue May 31, 2021 · 14 comments
Closed

KeyError: 'LDBNB' #5

SaLuci opened this issue May 31, 2021 · 14 comments
Labels
bug Something isn't working discussion Discussion about new features or behaviour modification

Comments

@SaLuci
Copy link

SaLuci commented May 31, 2021

Hey, after doing pip3 install -r requirements.txt and python3 main.py snapshot i get this message:

Traceback (most recent call last):
  File "main.py", line 75, in <module>
    cli()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "main.py", line 19, in snapshot
    crypto_report = bot.crypto.get_report()
  File "/home/ubuntu/binance-report-bot/bot/crypto.py", line 58, in get_report
    total_usdt += balances[symbol]*tickers[symbol]
KeyError: 'LDBNB'

heres my config.py

BINANCE_API_KEY = "XXXX"
BINANCE_API_SECRET = "XXXX"
COINS = ["ATOM","BAT","BTT","CAKE","ETC","ICX","IOTA","OMG","QTUM","ROSE","SRM","XLM","ONT","BNB","ZIL","ALGO","ADA","XRP","LTC","LINK","EOS","TRX","VET","NEO","DASH","MANA","OCEAN","UNI","MATIC","DOT"]
CURRENCY = "EUR" #Or USD
CURRENCY_SYMBOL = "€"
RICH_PRINTING = True

any idea?
Thanks in Advance

@titulebolide titulebolide added the bug Something isn't working label May 31, 2021
@titulebolide
Copy link
Owner

I'll make a commit soon so that you will be able to give me additional information

@titulebolide
Copy link
Owner

Can you pull the latest commit and run

python3 main.py snapshot --debug

And paste the output?
Thanks!

@SaLuci
Copy link
Author

SaLuci commented May 31, 2021

give me a sec....

@SaLuci
Copy link
Author

SaLuci commented May 31, 2021

This is the output:

['NEO', 'XRP', 'WIN', 'LDBNB', 'ZIL', 'ONT', 'EOS', 'MATIC', 'ICX', 'TRX', 'CAKE', 'IOTA', 'ATOM', 'BUSD', 'OMG', 'OCEAN', 'ROSE', 'AION', 'UNI', 'ETC', 'ADA', 'QTUM', 'DASH', 'BTT', 'REEF', 'BNB', 'MANA', 'WRX', 'VET', 'XLM', 'DOT', 'USDT', 'ALGO', 'LTC', 'EUR', 'BAT', 'PUNDIX', 'LINK', 'SRM']

{'USDT': 0.9992, 'USD': 1, 'NEO': 53.553, 'XRP': 0.9877, 'WIN': 0.0005151, 'ZIL': 0.1104, 'ONT': 1.0955, 'EOS': 6.1935, 'MATIC': 1.82155, 'ETH': 2598.59, 'ICX': 1.1066, 'TRX': 0.07472, 'CAKE': 17.385, 'IOTA': 1.0837, 'ATOM': 13.321, 'BUSD': 0.9995, 'OMG': 6.2565, 'OCEAN': 0.5907, 'ROSE': 0.07946, 'AION': 0.1978, 'UNI': 26.995, 'ETC': 67.757, 'ADA': 1.6611, 'QTUM': 11.657, 'DASH': 186.99, 'BTT': 0.0037234, 'REEF': 0.025933, 'BNB': 341.99, 'MANA': 0.812, 'WRX': 2.3167, 'VET': 0.11765, 'XLM': 0.39007, 'DOT': 22.065, 'ALGO': 0.911, 'LTC': 182.37, 'EUR': 1.2206, 'BTC': 36690.78, 'BAT': 0.7397, 'PUNDIX': 1.628, 'LINK': 30.334, 'SRM': 4.6316}

Traceback (most recent call last):
  File "main.py", line 80, in <module>
    cli()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "main.py", line 24, in snapshot
    crypto_report = bot.crypto.get_report(debug)
  File "/home/ubuntu/binance-report-bot/bot/crypto.py", line 61, in get_report
    total_usdt += balances[symbol]*tickers[symbol]
KeyError: 'LDBNB'

@titulebolide
Copy link
Owner

Do you have any coin in your wallet named "LDBNB"?

@SaLuci
Copy link
Author

SaLuci commented May 31, 2021

no, I thought the same, I got BNB.
I get the same Error with your default coins.

@titulebolide
Copy link
Owner

titulebolide commented Jun 1, 2021

That's weird, it's as if binance were saying you were holding LDBNB...
Could you run the following code in a python console (in the program's repository) and paste the result?:

import binance
import conf
api = binance.Client(conf.BINANCE_API_KEY, conf.BINANCE_API_SECRET)
print(sorted([t['asset'] for t in l['balances']]))

EDIT : Don't need to run the provious code, it seems that it has something to do with binance savings

@SaLuci
Copy link
Author

SaLuci commented Jun 1, 2021

That's weird, it's as if binance were saying you were holding LDBNB...
Could you run the following code in a python console (in the program's repository) and paste the result?:

import binance
import conf
api = binance.Client(conf.BINANCE_API_KEY, conf.BINANCE_API_SECRET)
print(sorted([t['asset'] for t in l['balances']]))

EDIT : Don't need to run the provious code, it seems that it has something to do with binance savings

Yeah your right, i got BNB in my savings account

@titulebolide
Copy link
Owner

titulebolide commented Jun 1, 2021

I had never heard about what saving accounts are. Do you consider it should to be taken in account in the bot's calculations?

@titulebolide titulebolide added the discussion Discussion about new features or behaviour modification label Jun 1, 2021
@SaLuci
Copy link
Author

SaLuci commented Jun 1, 2021

not really, those don't change much.
so i don't see a point in tracking them.

@titulebolide
Copy link
Owner

Okay then, i'll add a filter that exclude these for now. Thanks a lot for reporting and your help!

@SaLuci
Copy link
Author

SaLuci commented Jun 1, 2021

thank you for your time

@titulebolide
Copy link
Owner

I commited it, please reopen this issue if it still appears :)

@SaLuci
Copy link
Author

SaLuci commented Jun 1, 2021

Just pulled it, working now.
Thank you for your help

@SaLuci SaLuci mentioned this issue Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion Discussion about new features or behaviour modification
Projects
None yet
Development

No branches or pull requests

2 participants