CCXT – A JavaScript / Python / PHP cryptocurrency trading API with support for more than 120 bitcoin/altcoin exchanges
@Fcl69
ATTENTION! ALARM! ALARM! )
We are migrating from this chatroom to our new discoord server here:
Everyone is welcome to join! We will be happy to see you all there!
This chatroom will be archived after a while.
@hieudo92 New discord chat: https://discord.gg/dhzSKYU
Thank you! I have been joined with name is CoverLove
Like, do I have to do this ?
if (e instanceof ccxt.InsufficientFunds) {
error = 'InsufficientFunds';
}
if (e instanceof ccxt.OrderNotFillable) {
error = 'OrderNotFillable';
}
etc...
try {
} catch (e) {
console.log (e.constructor.name)
}
Hi guys, I'm new here. I have a big problem with the ccxt api. I'm writing here because I think that it is not a lib error, instead, it could be my error or exchange error, so.... this is my problem:
I'm using python and I wrote a sort of bot that calls something like 120 http requests per minute and in some particular cases, it could be 130/140 requests per minute. Anyway, the bot work, and it works great, but after 12h/24h it breaks for this error:
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 637, in fetch
verify=self.verify and self.validateServerSsl
File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, send_kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/adapters.py", line 532, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.bybit.com', port=443): Read timed out. (read timeout=60)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/home/ec2-user/.local/lib/python3.7/site-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/ec2-user/.local/lib/python3.7/site-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/home/ec2-user/.local/lib/python3.7/site-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args)
File "/home/ec2-user/echangeApiManager/controllers/futuresOpenedPositionsController.py", line 18, in futuresOpenedPositionsController
positions = exchange.fetch_positions(symbols=[symbol])
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/bybit.py", line 3278, in fetch_positions
response = self.privateLinearGetPositionList(self.extend(request, params))
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 496, in inner
return entry(_self, inner_kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 547, in request
return self.fetch2(path, api, method, params, headers, body, config, context)
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 543, in fetch2
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "/home/ec2-user/.local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 660, in fetch
raise RequestTimeout(details) from e
ccxt.base.errors.RequestTimeout: bybit GET https://api.bybit.com/private/linear/position/list?api_key=XXXXXXXXX&recv_window=5000&symbol=LUNA2USDT×tamp=16556140
20594&sign=XXXXXXXXXX
I tried different solutions:
1- repeat the request after 1 second for 5 times
2- increase the timeout
All of that doesn't work. Can someone explain to me why this error?