I've got unexpected Binance API error when trying to submit an order for ETHUSDT. The error looks standard:
{'code': -1013, 'msg': 'Filter failure: PERCENT_PRICE'}
I am passing an average price, retrieved a second ago using API's Symbol Price Ticker functions. My order function looks like:
params = {
"symbol": "ETHUSDT",
"side": "BUY",
"type": "LIMIT",
"quantity" : 0.1,
"timeInForce" : "GTC",
"price" : 3391, #A price from GET /api/v3/ticker/price
"recvWindow" : 40000
}
response = send_signed_request('POST', '/api/v3/order', params)
print(response)
But when passing a tenfold lower price the order completes without any errors. Also, other symbols don't raise any errors too, using the same pipeline. What am I doing wrong? Looks like bug, but not sure where to submit it.
Any advice will be appreciated!
The quantity and price are expected to be in a particular string format for it to work consistently. The Binance documentation on this is here.
You can use this syntax to apply formatting:
Note that
precision
in this example is an integer, not a step size.