diogomatoschaves / MyCryptoBot

Automated, open source crypto trading and backtesting platform
113 stars 23 forks source link

How can I solve the problem #181

Open MazeBraker opened 3 months ago

MazeBraker commented 3 months ago

I filled fileds BINANCE_API_KEY BINANCE_API_SECRET BINANCE_API_KEY_TEST BINANCE_API_SECRET_TEST and steps via instructions docker-compose up --build

After that I'm getting an error

data-service-1       | Starting scheduler.
data-service-1       | Adding job tentatively -- it will be properly scheduled when the scheduler starts
data-service-1       | Added job "check_app_health" to job store "default"
data-service-1       | Scheduler started
data-service-1       | Checking app health...
model-worker-1       | Worker rq:worker:d9ae9b64033844768d93e010d22cadb4 started with PID 7, version 1.14.1
model-worker-1       | Subscribing to channel rq:pubsub:d9ae9b64033844768d93e010d22cadb4
model-worker-1       | *** Listening on default...
execution-service-1  | Starting new HTTPS connection (1): api.binance.com:443
dashboard-1          | Compiled with warnings.
dashboard-1          | 
dashboard-1          | src/components/App.tsx
dashboard-1          |   Line 3:34:  'useHistory' is defined but never used  @typescript-eslint/no-unused-vars
dashboard-1          | 
dashboard-1          | src/components/Menu.tsx
dashboard-1          |   Line 62:11:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
dashboard-1          | 
dashboard-1          | src/utils/helpers/index.ts
dashboard-1          |   Line 147:20:  eval can be harmful                           no-eval
dashboard-1          |   Line 179:20:  eval can be harmful                           no-eval
dashboard-1          |   Line 180:11:  Comparing to itself is potentially pointless  no-self-compare
dashboard-1          |   Line 291:7:   'Split' is assigned a value but never used    @typescript-eslint/no-unused-vars
dashboard-1          | 
dashboard-1          | Search for the keywords to learn more about each warning.
dashboard-1          | To ignore, add // eslint-disable-next-line to the line before.
dashboard-1          | 
execution-service-1  | https://api.binance.com:443 "GET /api/v3/ping HTTP/1.1" 200 2
execution-service-1  | Starting new HTTPS connection (1): testnet.binance.vision:443
execution-service-1  | https://testnet.binance.vision:443 "GET /api/v3/ping HTTP/1.1" 200 2
execution-service-1  | Starting scheduler.
execution-service-1  | Adding job tentatively -- it will be properly scheduled when the scheduler starts
execution-service-1  | Added job "start_background_scheduler.<locals>.<lambda>" to job store "default"
execution-service-1  | Scheduler started
execution-service-1  | Looking for jobs to run
execution-service-1  | Next wakeup is due at 2024-03-31 10:38:18.231253-05:00 (in 179.996749 seconds)
execution-service-1  | Starting new HTTPS connection (1): testnet.binancefuture.com:443
execution-service-1  | https://testnet.binancefuture.com:443 "GET /fapi/v2/positionRisk?timestamp=1711899318313&signature=c136d5d2faddb5b9177acdd1a8e694ce6ad51cd8799e3ce57f4e9f2d16aa25b2 HTTP/1.1" 401 69
execution-service-1  | Exception on /open-positions [GET]
execution-service-1  | Traceback (most recent call last):
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
execution-service-1  |     response = self.full_dispatch_request()
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
execution-service-1  |     rv = self.handle_user_exception(e)
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
execution-service-1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
execution-service-1  |     rv = self.dispatch_request()
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
execution-service-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
execution-service-1  |   File "/usr/src/app/shared/utils/decorators/failed_connection.py", line 16, in wrapper
execution-service-1  |     return func(*args, **kwargs)
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 154, in decorator
execution-service-1  |     return current_app.ensure_sync(fn)(*args, **kwargs)
execution-service-1  |   File "/usr/src/app/execution/service/blueprints/market_data.py", line 89, in get_open_positions
execution-service-1  |     test_positions = testnet_client.futures_position_information()
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 6622, in futures_position_information
execution-service-1  |     return self._request_futures_api('get', 'positionRisk', True, 2, data=params)
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 383, in _request_futures_api
execution-service-1  |     return self._request(method, uri, signed, True, **kwargs)
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 359, in _request
execution-service-1  |     return self._handle_response(self.response)
execution-service-1  |   File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 368, in _handle_response
execution-service-1  |     raise BinanceAPIException(response, response.status_code, response.text)
execution-service-1  | binance.exceptions.BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action
data-service-1       | Expecting value: line 1 column 1 (char 0)
data-service-1       | Could not retrieve open positions.
diogomatoschaves commented 3 months ago

Hey @MazeBraker, it seems that you are using invalid keys, either for the testnet or real account.