bybit-exchange / pybit

Official Python3 API connector for Bybit's HTTP and WebSockets APIs.
Other
418 stars 135 forks source link

The number of contracts exceeds maximum limit allowed #244

Closed AlexShashkov closed 2 months ago

AlexShashkov commented 2 months ago

Stumbled upon strange exception while my bot was trading symbol ZKFUSDT on USDT perpetual, market price

It managed to open short on $13 out of given $750 (75 margin, lever 10, market price - 0.000930, amount - 13,940), but then immediately strarted throwing exceptions:

The number of contracts exceeds maximum limit allowed: too large, order_qty:80645000000000 > max_qty:56600000000000 (ErrCode: 10001) (ErrTime: 23:31:48).
Request → POST https://api.bybit.com/v5/order/create: {"category": "linear", "symbol": "ZKFUSDT", "side": "Sell", "qty": "806452.0", "reduceOnly": false, "closeOnTrigger": false, "orderType": "Market", "timeInForce": "GoodTillCancel"}.

And Im very confused with it. I tried looking up about max_qty and what exactly happened, but couldnt find anything. Also tried to find how to get contract size to calculate if my current ZKFUSDT contract amounts are below limits, but failed too.

AlexShashkov commented 2 months ago

Turned out I cant open order with more than 500 USDT specifically for that symbol. Is there any way to check that in the future?

dextertd commented 2 months ago

maxOrderQty maxMktOrderQty postOnlyMaxOrderQty https://bybit-exchange.github.io/docs/v5/market/instrument