CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.22k stars 302 forks source link

get_last_price crashes program when Binance announces a coin that isnt available on gate.io #49

Closed codylocks closed 3 years ago

codylocks commented 3 years ago

DAR was announced on Binance, it isnt available as a DAR_USDT trade pair and therefore returns an error which crashes the program. My solution was to add a try/except block to the request and then make it so if get_latest_price returns none if the response is an error instead of price and then telling the main function not to buy it if price=None. I also added a new json file of 'not listed' to check against so it is not trying to buy the unlisted coin every time its picked up by the scraper.

codylocks commented 3 years ago

I think the new updates have addressed this issue already. Will review and close the issue as necessary