Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Bittrex and Insufficient Funds #708

Closed
KryptoNova opened this issue Nov 14, 2017 · 2 comments
Closed

Bittrex and Insufficient Funds #708

KryptoNova opened this issue Nov 14, 2017 · 2 comments

Comments

@KryptoNova
Copy link
Contributor

I'm trying to place a manual trade in a live trading environment and am getting the error below. I have the buy_pct and sell_pct values set to 100 so that the entire balance is bought and sold each time. I am thinking it has something to do with rounding and it is one Sat more than what is in the account. I'm not exactly sure where this calculation takes place, but I guess it is in engine.js somewhere. Could someone point me to where this calculation takes place so I can handle rounding errors so the 100% purchase of asset works? Thanks!

manual limit BUY command executed
INSUFFICIENT_FUNDS


{ Error: order not found in cache
    at Object.getOrder (/root/nodeJS/zenbot/extensions/exchanges/bittrex/exchange.js:263:29)
    at Timeout.checkOrder [as _onTimeout] (/root/nodeJS/zenbot/lib/engine.js:283:24)
    at ontimeout (timers.js:469:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5) desc: 'could not execute buy: error placing order' }

KryptoNova added a commit to KryptoNova/zenbot that referenced this issue Nov 15, 2017
Added if statements so the exchange can have it's cut out of the purchase of the asset.
Most exchanges want their cut in BTC rather than the alt-coin being processed.
This modification allows for the exchange fee to be removed from the overall purchase price allowing for 100% of the currency balance to be spent without an insufficient funds error popping up.
DeviaVir pushed a commit that referenced this issue Nov 15, 2017
Added if statements so the exchange can have it's cut out of the purchase of the asset.
Most exchanges want their cut in BTC rather than the alt-coin being processed.
This modification allows for the exchange fee to be removed from the overall purchase price allowing for 100% of the currency balance to be spent without an insufficient funds error popping up.
@ether-btc
Copy link

with bittrex "99.5"% works. With Gdax I found, "99.6"% works.
buy_pct=99.5 and buy_pct=99.6 respectively.
sell_pct=100 works fine both on bittrex and gdax.

Is it the bot that fails to being able to buy 100% or is it the exchanges fault I wonder. Never got to find out who is the culprit.

@KryptoNova
Copy link
Contributor Author

To answer @ether-btc it is both. The bot wasn't taking a fee into account when determining the amount of asset to buy to leave enough BTC in the account to cover the fee. I think that Bittrex needs a way to handle a 1 sat rounding problem.

Closing for now as I do believe that #711 has addressed this for 100% buys.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants