Open O4karitO opened 6 years ago
i found a workaround for this.
def normalize_fraction(d):
normalized = d.normalize()
sign, digit, exponent = normalized.as_tuple()
return normalized if exponent <= 0 else normalized.quantize(1)
decimals = Decimal(normalize_fraction(Decimal(ticker.bid.qty))).as_tuple().exponent
this will return -2 as LTC has 2 decimal places over BTCamount_to_buy = round(1.25684, (decimals*-1))
From time to time I get Filter failure: LOT_SIZE error. From what I found it is because binance has a different minimum order volume for each coin. And anything smaller returns an error. in other words for a certain coin 512.6 might be fine but 512.63 will return an error. Number of decimal points allowed is different for every coin