question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binance Coin Future quantity min amount limit and precision issue

See original GitHub issue
  • OS: Windows
  • Programming Language version: python 3.8.7
  • CCXT version: 1.40.23
import ccxt
exchange = ccxt.binance({
    'apiKey': API_key,
    'secret': Secret_key,
    # 'timeout': 30000,
    'enableRateLimit': True,
    'hedgeMode': False,
    'options': {
        'defaultType': 'delivery',  # testnet urls work with futures
    }
})
markets = exchange.load_markets()
exchange.verbose = True
print(exchange.create_order("ETH/USD", "market", "buy", 0.02, price=None, params={}))
Request: POST https://dapi.binance.com/dapi/v1/order {'X-MBX-APIKEY': '', 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'python-requests/2.25.1', 'Accept-Encoding': 'gzip, deflate'} timestamp=1611236325992&recvWindow=5000&symbol=ETHUSD_PERP&type=MARKET&side=BUY&quantity=0&signature=

Response: POST https://dapi.binance.com/dapi/v1/order 400 {'Content-Type': 'application/json', 'Content-Length': '47', 'Connection': 'keep-alive', 'Date': 'Thu, 21 Jan 2021 13:38:47 GMT', 'Server': 'Tengine', 'X-MBX-USED-WEIGHT-1M': '2', 'X-MBX-ORDER-COUNT-1M': '1', 'x-response-time': '1ms', 'X-Frame-Options': 'SAMEORIGIN', 'X-Xss-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'origin-when-cross-origin', 'Strict-Transport-Security': 'max-age=31536000; 
includeSubdomains', 'X-Cache': 'Error from cloudfront'} {"code":-4003,"msg":"Quantity less than zero."}

ccxt.base.errors.ExchangeError: binance {"code":-4003,"msg":"Quantity less than zero."}

I am trying to create a market order with coin futures ETH USD pair. I have 0.02 ETH in my account,

main error quantity is less than zero from binance but when ccxt calls binance we are passing quantity 0, so it looks precision and limits is problem

limits for ETHUSD : {‘amount’: {‘min’: 1.0, ‘max’: 100000.0}, ‘price’: {‘min’: 0.01, ‘max’: 100000.0}, ‘cost’: {‘min’: None, ‘max’: None}, ‘market’: {‘min’: 1.0, ‘max’: 100000.0}}

Precision for ETHUSD: {‘base’: 8, ‘quote’: 8, ‘amount’: 0, ‘price’: 2}

it looks it fails below condition: Order amount >= limits[‘min’][‘amount’]

does that mean we can’t create an order for ETHUSD for less than 1 ETH?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
robzercommented, Apr 17, 2021

of course, sorry about his, zzz i need sleep. thx for the quick answer. Ah thanks for flagging the universal transfer feature. Will definitely consider it.

1reaction
Eternal-Sunshinecommented, Feb 8, 2021

It was working earlier with 1$ also. Binance suddenly changed the rule. We got panicked in the team. It got clarified now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trading Rules of USDS-Margined Contracts | Binance Futures
Trading rules of USDS-Margined contracts on Binance: minimum trading amount, minimum order price, limit order price cap, maximum market order, maximum open ...
Read more >
Trading Rules | Binance
Minimum Price Movement. 0.000001 BTC. Minimum Order Size. 0.0001 BTC. Maximum Market Order Amount. 1580.45065923 ETH. Max. Number of Open Limit Orders.
Read more >
New Minimum Order Notional Limit Rule for USDS-M Futures
Binance Futures will launch a new minimum order notional limit rule for all USDS-M futures contracts at 2021-01-25 7:00:00 (UTC).
Read more >
Trading Limits and Rules - Binance
Please refer to the link below for the latest trading rules: https://www.bi.
Read more >
Rate Limits on Binance Futures
Binance Futures provides rate limit adjustment flexibility via a volume-based tier system. The default rate limit per IP is 2400/min, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found