hinnecco / Pancake_Trading_BOT

Bot to monitor price and execute transactions using PancakeSwap Router V2
4 stars 1 forks source link

Error : when price hit buying target #1

Open Kelberwitz opened 2 years ago

Kelberwitz commented 2 years ago

Exception in thread Thread-1 (function): Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner self.run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self._target(*self._args, *self._kwargs) File "C:\Users\Administrator\Desktop\trading\utils.py", line 79, in function self.result = target(args, **kwargs) File "C:\Users\Administrator\Desktop\trading\utils.py", line 350, in buyTokensWithOtherToken toBuyAmount = web3.toWei(kwargs.get('Amount')) TypeError: to_wei() missing 1 required positional argument: 'unit' Traceback (most recent call last): File "C:\Users\Administrator\Desktop\trading\main.py", line 258, in tx, Lasttrade_message = transaction.result AttributeError: 'ThreadWithResult' object has no attribute 'result'

hinnecco commented 2 years ago

I believe it is related to the function buying specific amount, probably need convert the amount to Wei, I will check today night and add a new version fixing! Thank you for the feedback!