cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
199 stars 78 forks source link

Take transfer times into account while managing coins #1

Closed cryptoeax closed 6 years ago

cryptoeax commented 6 years ago

See https://github.com/opencryptotrader/arbbot/issues/20#issuecomment-348802101.

cryptoeax commented 6 years ago

Poloniex API: https://poloniex.com/public?command=returnCurrencies Bittrex API: https://bittrex.com/api/v1.1/public/getcurrencies

cryptoeax commented 6 years ago

@jjc6676 Do you mind testing this please?

(Note that after updating the bot, it will liquidate your assets which have a higher minimum confirmation time of 50. You can customize this in config.ini, please see the example file.)

jjc6676 commented 6 years ago

Testing this out now

jjc6676 commented 6 years ago

Does this mean anything to you?

2017/12/03 17:04:15 [error] 993#993: *77064 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/home/jason/arbbot-master/web/config.inc.php): failed to open stream: No such file or directory in /home/jason/arbbot-master/web/WebDB.php on line 4 PHP message: PHP Fatal error: require_once(): Failed opening required '/home/jason/arbbot-master/web/config.inc.php' (include_path='.:/usr/share/php') in /home/jason/arbbot-master/web/WebDB.php on line 4" while reading response header from upstream, client: 192.168.198.1, server: localhost, request: "GET /log.php?_=1512349449066 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "192.168.198.132", referrer: "http://192.168.198.132/" 2017/12/03 17:04:15 [error] 993#993: *77141 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/home/jason/arbbot-master/web/config.inc.php): failed to open stream: No such file or directory in /home/jason/arbbot-master/web/WebDB.php on line 4 PHP message: PHP Fatal error: require_once(): Failed opening required '/home/jason/arbbot-master/web/config.inc.php' (include_path='.:/usr/share/php') in /home/jason/arbbot-master/web/WebDB.php on line 4" while reading response header from upstream, client: 192.168.198.1, server: localhost, request: "GET /pl.php?_=1512349449067 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "192.168.198.132", referrer: "http://192.168.198.132/"

cryptoeax commented 6 years ago

Yes, you have forgotten the config.inc.php file in the web subdirectory. The installation instructions in the README describe how to get this file.

jjc6676 commented 6 years ago

I must have grabbed that error then from earlier. My folder currently has that file that I copied from my last folder.

I noticed that your bot has 1800+ trades! WOW!

What is your min-profit set at if you don't mind me asking.

jjc6676 commented 6 years ago

Also in your readme you stated

You can see the bot running on a cheap linode here:

It just takes me to the linode site. Was just curios haha!

jjc6676 commented 6 years ago

Also - I am currently thinking of a way that we could reduce negative trades. Discussing it with a few partners, and we are thinking that maybe blacklisting a coin for x amount of time after a negative trade may be a good idea. More than likely though it just means someone beans our bot to the arbitrage.

Curious to know if you have any ideas. Currently my bot has Profitable trades: 85.71%

However with that said some of the losses are considerably larger than the gains. One of my largest losses was at 0.01583182 BTC

jjc6676 commented 6 years ago

Another issue I am seeing is that some coins require a minimum on the order book. This sometimes leaves the inability to sell coins due to the fact there there are only 5 of said coin, instead of the 10 need to be the minimum order size of 0.00050000 With that said, we are stuck with a few coins and the inability to sell them.

Most coins from what I can tell require a minimum order size.

The minimum order size is .00050000

jjc6676 commented 6 years ago

Had an error on my bot as well

`04:52:53: Error during main loop: database insertion error: Data too long for column 'address' at row 1

0 /home/jason/arbbot-master/CoinManager.php(741): Database::saveWithdrawal('SC', 5386.21604884204, '5f1232d8333d78b...', 1, 3)

1 /home/jason/arbbot-master/Arbitrator.php(356): CoinManager->withdraw(Object(Poloniex), Object(Bittrex), 'SC', 5386.21604884204)

2 /home/jason/arbbot-master/Arbitrator.php(183): Arbitrator->trade(Object(Orderbook), Object(Orderbook), 'SC', 'BTC')

3 /home/jason/arbbot-master/Arbitrator.php(132): Arbitrator->checkAndTrade(Object(Orderbook), Object(Orderbook))

4 /home/jason/arbbot-master/Arbitrator.php(122): Arbitrator->testOrderbooks(Object(Orderbook), Object(Orderbook))

5 /home/jason/arbbot-master/Arbitrator.php(85): Arbitrator->checkPairAt('SC_BTC', Object(Bittrex), Object(Poloniex))

6 /home/jason/arbbot-master/Arbitrator.php(63): Arbitrator->checkOpportunitiesAt(Object(Bittrex), Object(Poloniex))

7 /home/jason/arbbot-master/Arbitrator.php(50): Arbitrator->checkOpportunities()

8 /home/jason/arbbot-master/Arbitrator.php(438): Arbitrator->loop()

9 /home/jason/arbbot-master/main.php(62): Arbitrator->run()`

cryptoeax commented 6 years ago

I noticed that your bot has 1800+ trades! WOW!

Yes, my bot makes ~300-400 trades per day at its current configuration. :-)

What is your min-profit set at if you don't mind me asking.

The default, 0.00000050.

Also - I am currently thinking of a way that we could reduce negative trades. Discussing it with a few partners, and we are thinking that maybe blacklisting a coin for x amount of time after a negative trade may be a good idea. More than likely though it just means someone beans our bot to the arbitrage.

I would be open to good ideas. I think once we have data from the bot running in its optimized configuration for a long time (maybe a month or so) we can backtest to see if heuristics like what you suggest is a good strategy, but I'm reluctant to guesswork too much, since it can easily backfire also. So far, I have been optimizing the accuracy of the bot by tweaking the coin management algorithm to tweak the needed balance for the assets that are undesirable (for example have a high transfer fee, or transfer time as you had suggested.) With the former idea alone, I managed to increase the efficiency of my instance from ~70% to ~90%.

Curious to know if you have any ideas. Currently my bot has Profitable trades: 85.71%

Note that I have been tweaking the bot for a while, so looking at the overall percentage will be misleading for a while since it will show you the result of running the bot with a mixture of improved and non-improved algorithms. I suggest going to daily graphs and looking at your profitable trade % per day. I finished yesterday with 92.64%. You want to be higher than 90% if possible.

However with that said some of the losses are considerably larger than the gains. One of my largest losses was at 0.01583182 BTC

Note that each trade is a risk, but perhaps you may want to start tweaking your buy-factor and sell-factor settings a bit? I am using 1.025 and 0.975 currently.

Do you mind filing two separate issues for the last two comments please so I won't forget to look at them? Thanks!

kingchenc commented 6 years ago

@cryptoeax can you share your config? 300-400 trades per day? nice

cryptoeax commented 6 years ago

@cryptoeax can you share your config? 300-400 trades per day? nice

The speed of the bot mostly depends on a few things: