TeamWertarbyte / crypto-trading-bot

A trading bot that does what you order him to do (use at your own risk)
MIT License
30 stars 18 forks source link

Performance problem it takes 525448.93998 ms to finish #37

Open engAhmad opened 3 years ago

engAhmad commented 3 years ago

Performance: This comes due to the limitation of the bittrex api. It only allows ~60requests per minute. So we have some manual wait time between requests to not get blocked. Sadly this results in the long total amount. We could see which requests we can omit to speed things up. But for now I don't know which.

Stopping buying new coins: Maybe there isn't any viable option for buying currently? Adding those shouldn't general break the evaluation of other options. I'll improve the logging to reflect this behavior. Would you mind opening an issue for that?

Originally posted by @saschb2b in https://github.com/TeamWertarbyte/crypto-trading-bot/discussions/33#discussioncomment-384610

Call Limits The Bittrex API employs call limits on all REST endpoints to ensure the efficiency and availability of the platform for all customers. Limits are set such that they should not interfere with legitimate usage patterns. Frequent polling for updates on market data, order status, history, etc. is discouraged and will likely result in your requests failing with a 429 status code. If you need frequent updates, subscribe to the websocket instead of polling. Frivolous order placement and cancellation in a tight loop with low fill rates is also discouraged.

https://bittrex.github.io/api/v3

saschb2b commented 3 years ago

Switching to sockets is a great idea! Will see what their api offers on that connection. Additionally I noticied we currently iterate over several "dust" balances in our portfolio. We can (let's see how) detect and skip them to get an additonal boost

engAhmad commented 3 years ago

Additionally I noticied we currently iterate over several "dust" balances in our portfolio. We can (let's see how) detect and skip them to get an additonal boost .

What do you mean "dust” ,

the trade remaining ? Or unprofitable coins ?

Btw i created slack channel and invited you if you wish for better communication , brainstorming, etc welcome to join

saschb2b commented 3 years ago

Thanks for the invite, joined!

Dust are all assets that are in your portfolio but only worth a few bucks. Like 0.24$ of Digibyte. Currently the bot sees it and thinks "Well we still got some, so I don't need to buy more" or it tries to sell it due to bad EMA but can't due to minimum trading rate being greater of what you hold. I had like 4-5 dust assets that "blocked" further transactions. But corrected them manually now. I think with the current implementation we shouldn't get any more dust coins as we use fill_or_kill for selling. So there is no "partially sold" assets Tldr: Fixed it manually and we shouldn't care about it anyway I think

engAhmad commented 3 years ago

Regrading to Dust Coins issue , i think simply sell them if they under certain amount specified by the user e.g. under 0.5 USDT if this value not reach minimum trading rate so the bot should buy some to reach the trading rate then sell them