close

How to place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

How to place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset?

  1. How to place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset?

    You are going to set futures position. But requesting pair info for spot. For futures' pairs you can get precision by calling .futures_exchange_info()

  2. place a futures market order using python-binance: APIError(code=-1111): Precision is over the maximum defined for this asset

    You are going to set futures position. But requesting pair info for spot. For futures' pairs you can get precision by calling .futures_exchange_info()

Method 1

Instead use hardcode precision, you can call api to retrieve the stepSize:

symbol_info = client.get_symbol_info('BTCUSDT')
step_size = 0.0
for f in symbol_info['filters']:
  if f['filterType'] == 'LOT_SIZE':
    step_size = float(f['stepSize'])


precision = int(round(-math.log(stepSize, 10), 0))
quantity = float(round(quantity, precision))

client.futures_create_order(symbol=sym, side='BUY', type='MARKET', quantity=quantity)

Method 2

You are going to set futures position. But requesting pair info for spot. For futures’ pairs you can get precision by calling .futures_exchange_info()

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read