sthewissen / Mynt

An Azure Functions-based crypto currency trading bot; featuring 10 exchanges, 25 indicators, custom strategy support, backtester and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binance transaction fee in BNB bug

dinckaniskan opened this issue · comments

I believe there might be an issue when paying fees using BNB. Asset quantity that's persisted into the database doesn't match whats in the exchange wallet so there's a tiny amount of the asset left after a sell action.

When a first order is placed the bot divides the investment amount by the current rate you're buying it for. That quantity is sent to the exchange as the quantity of tokens you want to buy. Exchanges like Binance that use a maximum lot size (e.g. you cannot buy 3.91 of a token, only 3.9) then adjust that quantity as needed. However, when checking the buy order to see if it is filled Mynt always uses the quantity that was actually put on order, so the actual amount you're getting is always used. This is stored within Mynt and the exact same amount is used on the sell order. Therefore what you buy should always match what you sell.

I can't quite place my finger on why this is happening for you. Do you happen to have some referral users? Perhaps these referrals are giving you minimal amounts of those coins outside of Mynt? Another option could be that you bought those same coins when not using BNB for fees which always leaves a bit of dust?

If you check your open orders on the exchange and look at the buy/sell orders that Mynt has placed you should be able to tell if the amount bought matches the amount sold. I'd love to see a sample if this was not the case so I could diagnose further.