Python-Binance.US api: APIError: (code=-1013): Filter failure: LOT_SIZE

Viewed 34

I am receiving an API error when trying to place a sell order. My buy orders are working fine.

Request parameters:

{'symbol': 'BTCUSD', 'side': 'SELL', 'type': 'MARKET', 'quantity': '0.04965054', 'newOrderRespType': 'RESULT', 'timestamp': 1662864898133}

API error:

{'code': -1013, 'msg': 'Filter failure: LOT_SIZE'}
1 Answers

I found the issue. It was a result of the stepSize. Here is the code I used to fix it:

quantity = str(step_size * math.floor(float(quantity) / step_size))
Related