aloysius-pgast / crypto-exchanges-gateway

Your gateway to the world of crypto !
588 stars 152 forks source link

New Orders Giving Invalid Lot Size Error - Binance #32

Closed insanid closed 6 years ago

insanid commented 6 years ago

When placing a buy or sell order on Binance I receive the error Invalid Lot Size. This doesn't happen on all pairs, only pairs in which the minimum order price has a minimum tick requirement.

On the Binance market ETH/TRX, the minimum price is 0.00000001, however on ETH/DGD, the minimum price is 0.00001. Since the crypto-exchanges-gateway defaults to including 8 ticks (decimals) on all pairs, Binance rejects orders with Invalid Lot Size if the pair has a minimum tick for the price.

pipinoloco commented 6 years ago

i can buy TRX with 500 as order, but if i put to buy 326 it rejects with the same mistake

insanid commented 6 years ago

@pipinoloco I just tried prices 0.00000326 and 0.00000500 on ETH/TRX and got the invalid lot size error.

aloysius-pgast commented 6 years ago

Hi. On Binance you need to match minimum price and minimum quantity and minimum overall price. Problem might be with the quantity. Do you have an example with qty & rate which is refused by Binance ?

pipinoloco commented 6 years ago

as most of the trade is done with bots, it shouldn-t be a bug of the crypto exchange

aloysius-pgast commented 6 years ago

I don't think it's a bug but more a problem with the request which does not match one of Binance conditions :

insanid commented 6 years ago

@aloysius-pgast Here's an example of an order that gives the LOT_SIZE error:

Market: ETH/DGD

Quantity: 25.37990364 BID: 0.10000000 Total: 2.53799036 Estimated Fees: (0.05%): 0.00126899 Total (Including Fees): 2.53925936

In my config I specified "feesPercent":0.05, for Binance. Note: This LOT_SIZE error also occurs with setting the fee to 0.10

aloysius-pgast commented 6 years ago

Thanks for the feedback. Based on information returned from https://www.binance.com/api/v1/exchangeInfo, quantity must be a multiple of 0.00100000. I'm working on a way to handle those precision/lot limits but until it is done, you will need to update the quantity in the UI so that it's a multiple of 0.00100000

insanid commented 6 years ago

@aloysius-pgast Okay, I just performed git pull on the latest commit. I took your advice on a temporary workaround and placed an order with a quantity in a multiple of 0.001. The quantity was 4.80000000 @ price .10000000 and it went through.

aloysius-pgast commented 6 years ago

Hi @insanid : just pushed some changes on develop branch. Informations regarding limits are now be provided in UI. Let me know if it's better