cryptoeax / arbbot

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

Base currency #143

Closed OlegVic closed 6 years ago

OlegVic commented 6 years ago

Some exchanges no have currencies like (USD, EUR) just only BX.IN.TH https://bx.in.th/api/pairing/ I think bot can not see real balance and try buy altcoins with balance (zero bitcoins)

cryptoeax commented 6 years ago

Sorry, I'm not sure if I understand what you mean... If you're saying that this exchange doesn't support a fiat currency like USD or EUR, that's OK, the bot never needs it, it should only be looking at the BTC markets. i.e., you should only look at pairings with primary_currency = BTC.

If I am not understanding you correctly, can you please try explaining the problem you're seeing better? Thanks :-)

OlegVic commented 6 years ago

Maybe im mistake. But i saw situation bot try buy altcoins with zero balance in BTC

cryptoeax commented 6 years ago

No, why?

Let's say that you start with a zero balance on all of your wallets on this exchange but you have some BTC on another exchange. The bot will notice this, and transfer some BTC to your BTC wallet on BX. After that it will have some BTC balance there that it can use to buy altcoins with when the user sets some autobuy funds.

This is exactly how things work on all of the exchanges the bot supports. The bot never touches fiat currencies.

Am I missing something above?

OlegVic commented 6 years ago

http://joxi.ru/52aye9zfG5b9W2 you see my balances? and with this balances i saw BOT want buy altcoins on BX That is why i start think why? And i got error from API like your balance is 0 can not buy coins!

OlegVic commented 6 years ago

i got one more case Posting buy order to BXINTH: 1377.71575569 DOGE for 0.00075774 @ 0.00000055 22:10:04: ERROR during management task: bxinth {"success":false,"order_id":0,"error":"Amount entered in more than your 0.00000000 available balance (1377.71575569)"}

0 [internal function]: ccxt\bxinth->request('order', 'private', 'POST', Array)

But have zero balance on BX

cryptoeax commented 6 years ago

If the balance of your BTC on the exchange is also 0, that suggests that there is a bug in the code that reads the exchange parameters somewhere that makes the bot not realize it has insufficient BTC balance for a buy order.

Here is a pointer to the logic on the Arbitrator side to help you find the bug in your code:

https://github.com/cryptoeax/arbbot/blob/f2832f1c0cfc0acefc4171806c585e9c40d81da5/bot/Arbitrator.php#L274

The bot picks the minimum of min( $maxTradeSize, $sourceCurrencyBefore ) / $bestBuyRate and $bestBuyAmount as the number of altcoins that it can buy on the source exchange (in this case BX.) $sourceCurrencyBefore is your BTC balance. You should be able to figure out the rest by reading the code. :-)

cryptoeax commented 6 years ago

Closing the issue unless if you find a bug in the bot's code which is highly unlikely since it is working well for 4 exchanges already.