enarjord / passivbot

Trading bot running on Bybit, Bitget, OKX, GateIO, Binance and Hyperliquid
https://www.passivbot.com
Other
1.09k stars 413 forks source link

okx - Order amount exceeds the current tier limit. Please lower the leverage - Bulk operation partially successful #370

Closed ilaykim closed 1 year ago

ilaykim commented 1 year ago
  1. not serious.
  2. error isn't because of the leverage.
  3. error is related to specific shitcoin pair, couldn't get it again with other coin.
 "ohlcv": false,
 "passivbot_mode": "neat_grid",
 "price_distance_threshold": 0.5,
 "short": {"auto_unstuck_ema_dist": 0.004166734020707882,
           "auto_unstuck_wallet_exposure_threshold": 0.09483563420728498,
           "backwards_tp": true,
           "ema_span_0": 240,
           "ema_span_1": 240,
           "enabled": true,
           "eprice_exp_base": 0.9030929538070822,
           "eqty_exp_base": 1.139844561045326,
           "grid_span": 0.5588225833929379,
           "initial_eprice_ema_dist": -0.0403097381673301,
           "initial_qty_pct": 0.015,
           "markup_range": 0.01710717452246016,
           "max_n_entry_orders": 12,
           "min_markup": 0.0032327368401944916,
           "n_close_orders": 10,
           "wallet_exposure_limit": 0.2},
 "symbol": "AGLDUSDT",
 "test_mode": false,
 "user": "okx_01"}
2023-01-08T17:39:41 INFO     starting passivbot in ohlcv mode, using REST API only and updating once a minute
2023-01-08T17:39:41 INFO     {'code': '0', 'data': [{'instId': 'AGLD-USDT-SWAP', 'lever': '75', 'mgnMode': 'cross', 'posSide': ''}], 'msg': ''}
2023-01-08T17:39:41 INFO     {'code': '0', 'data': [{'instId': 'AGLD-USDT-SWAP', 'lever': '75', 'mgnMode': 'cross', 'posSide': ''}], 'msg': ''}
okx {"code":"59000","data":[],"msg":"Settings failed. Close any open positions or orders before modifying settings."}
2023-01-08T17:39:44 INFO     starting bot...
2023-01-08T17:40:00 INFO     heartbeat AGLD/USDT:USDT
2023-01-08T17:40:00 INFO     long: 0.0 @ 0.0 lWE: 0.0000 pprc diff -1.000 EMAs: [0.26671, 0.2663, 0.26588] e 0.0 @ 0.0 | c 0.0 @ 0.0
2023-01-08T17:40:00 INFO     short: 0.0 @ 0.0 sWE: 0.0000 pprc diff 1.000 EMAs: [0.26615, 0.26615, 0.26615] e 0.0 @ 0.0 | c 0.0 @ 0.0
2023-01-08T17:40:00 INFO     balance: 99.9993 equity: 99.9993 last price: 0.2676 liq: 0.0
error executing order None okx {"code":"2","data":[{"clOrdId":"shortientry1f48d63ee309402790a4f","ordId":"532342745382756352","sCode":"0","sMsg":"Order placed","tag":""},{"clOrdId":"longientry6542aa74070140a5ad82fa","ordId":"","sCode":"51004","sMsg":"Order amount exceeds the current tier limit. Please lower the leverage. ","tag":""}],"msg":"Bulk operation partially successful"}
returned: None
Traceback (most recent call last):
  File "/home/bot/testing/passivbot/okx.py", line 213, in execute_orders
    executed = await self.okx.private_post_trade_batch_orders(params=to_execute)
  File "/home/bot/.local/lib/python3.10/site-packages/ccxt/async_support/base/exchange.py", line 1125, in request
    return await self.fetch2(path, api, method, params, headers, body, config, context)
  File "/home/bot/.local/lib/python3.10/site-packages/ccxt/async_support/base/exchange.py", line 1122, in fetch2
    return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "/home/bot/.local/lib/python3.10/site-packages/ccxt/async_support/base/exchange.py", line 163, in fetch
    self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
  File "/home/bot/.local/lib/python3.10/site-packages/ccxt/async_support/okx.py", line 5045, in handle_errors
    self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
  File "/home/bot/.local/lib/python3.10/site-packages/ccxt/async_support/base/exchange.py", line 1343, in throw_exactly_matched_exception
    raise exact[string](message)
ccxt.base.errors.InvalidOrder: okx {"code":"2","data":[{"clOrdId":"shortientry1f48d63ee309402790a4f","ordId":"532342745382756352","sCode":"0","sMsg":"Order placed","tag":""},{"clOrdId":"longientry6542aa74070140a5ad82fa","ordId":"","sCode":"51004","sMsg":"Order amount exceeds the current tier limit. Please lower the leverage. ","tag":""}],"msg":"Bulk operation partially successful"}
enarjord commented 1 year ago

fixed by adding contract multiplier parameter to linear calcs in njit_funcs.py