enarjord / passivbot

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

error initiating market type okx GET,How to solve this problem #402

Open 798996741 opened 1 year ago

798996741 commented 1 year ago

{"api_keys": "api-keys.json", "config_name": "recursive_grid_0days", "countdown": false, "countdown_offset": 54, "exchange": "okx", "leverage": 7, "logging_level": 0, "long": {"auto_unstuck_ema_dist": -0.0004485433735772453, "auto_unstuck_wallet_exposure_threshold": 0.08309920060779757, "backwards_tp": true, "ddown_factor": 1.9258495772247657, "ema_span_0": 614.3777429911439, "ema_span_1": 769.6056524758465, "enabled": true, "initial_eprice_ema_dist": 0.01349743268663619, "initial_qty_pct": 0.01731329191393277, "markup_range": 0.007522478552479395, "min_markup": 0.006685757308876835, "n_close_orders": 4, "rentry_pprice_dist": 0.028418561060456284, "rentry_pprice_dist_wallet_exposure_weighting": 0.0, "wallet_exposure_limit": 0.3}, "market_type": "futures", "ohlcv": true, "passivbot_mode": "recursive_grid", "price_distance_threshold": 0.5, "price_precision_multiplier": None, "price_step_custom": None, "short": {"auto_unstuck_ema_dist": -0.04320275323394985, "auto_unstuck_wallet_exposure_threshold": 0.0489925961709369, "backwards_tp": true, "ddown_factor": 0.46697925401591367, "ema_span_0": 499.2872624543112, "ema_span_1": 293.36895365074724, "enabled": false, "initial_eprice_ema_dist": -0.09492544670885654, "initial_qty_pct": 0.08400674888677653, "markup_range": 0.0320842479028585, "min_markup": 0.0024570311267245438, "n_close_orders": 7, "rentry_pprice_dist": 0.02340422571566266, "rentry_pprice_dist_wallet_exposure_weighting": 27.634531695711928, "wallet_exposure_limit": 1.0}, "short_mode": "manual", "symbol": "1INCHUSDT", "test_mode": false, "user": "okx_01"} 2023-05-08T22:49:33 ERROR error initiating market type okx GET https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD returned: None Traceback (most recent call last): File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 121, in fetch async with session_method(yarl.URL(url, encoded=True), File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 1138, in aenter self._resp = await self._coro File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 466, in _request with timer: File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\helpers.py", line 721, in exit raise asyncio.TimeoutError from None asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\ideaProject\passivbot\exchanges\okx.py", line 33, in init_market_type self.markets = await self.okx.fetch_markets() File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\okx.py", line 863, in fetch_markets promises = await asyncio.gather(*promises) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\okx.py", line 1026, in fetch_markets_by_type response = await self.publicGetPublicInstruments(self.extend(request, params)) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 1158, in request return await self.fetch2(path, api, method, params, headers, body, config, context) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 1155, in fetch2 return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 155, in fetch raise RequestTimeout(details) from e ccxt.base.errors.RequestTimeout: okx GET https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD 2023-05-08T22:49:33 ERROR There was an error starting the bot: stopping bot Traceback (most recent call last): File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 121, in fetch async with session_method(yarl.URL(url, encoded=True), File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 1138, in aenter self._resp = await self._coro File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 466, in _request with timer: File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\helpers.py", line 721, in exit raise asyncio.TimeoutError from None asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\ideaProject\passivbot\exchanges\okx.py", line 33, in init_market_type self.markets = await self.okx.fetch_markets() File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\okx.py", line 863, in fetch_markets promises = await asyncio.gather(*promises) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\okx.py", line 1026, in fetch_markets_by_type response = await self.publicGetPublicInstruments(self.extend(request, params)) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 1158, in request return await self.fetch2(path, api, method, params, headers, body, config, context) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 1155, in fetch2 return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\site-packages\ccxt\async_support\base\exchange.py", line 155, in fetch raise RequestTimeout(details) from e ccxt.base.errors.RequestTimeout: okx GET https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\ideaProject\passivbot\passivbot.py", line 1909, in asyncio.run(main()) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main) File "C:\Users\86176\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "D:\ideaProject\passivbot\passivbot.py", line 1886, in main bot = await create_okx_bot(config) File "D:\ideaProject\passivbot\procedures.py", line 337, in create_okx_bot await bot._init() File "D:\ideaProject\passivbot\exchanges\okx.py", line 47, in _init await self.init_market_type() File "D:\ideaProject\passivbot\exchanges\okx.py", line 44, in init_market_type raise Exception("stopping bot") Exception: stopping bot 2023-05-08T22:49:33 ERROR Passivbot was stopped succesfully

flancer1990 commented 7 months ago

I encountered the same problem, have you solved it?

enarjord commented 7 months ago

Looks like symbol BTCUSD was given. OKX only works on perpetual USDT margined futures. Try symbol BTCUSDT