Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Binance Trade Bot is running use it's database api instead of operating on the database file #23

Open
lorcalhost opened this issue Apr 4, 2021 · 4 comments
Labels
priority:low type:enhancement New feature or request

Comments

@lorcalhost
Copy link
Owner

The mysqlalchemy session implementation used in Binance Trade Bot only updates the database file every now and then and at the end of the session.
To fetch good data switch to their database API.

Thanks @DmytroLitvinov for finding the cause of the slow data update problem.

@lorcalhost lorcalhost added type:enhancement New feature or request warn:help wanted Extra attention is needed labels Apr 4, 2021
@lorcalhost
Copy link
Owner Author

lorcalhost commented Apr 4, 2021

The api server should be launched using the following command:

gunicorn binance_trade_bot.api_server:app -k eventlet -w 1 --threads 1 -b 0.0.0.0:5123

Dependencies: python3-gunicorn==20.0.4-3

@lorcalhost
Copy link
Owner Author

Endpoints are:

  • /api/value_history/<coin> or /api/value_history
  • /api/total_value_history
  • /api/trade_history
  • /api/scouting_history
  • /api/current_coin
  • /api/current_coin_history
  • /api/coins
  • /api/pairs

@lorcalhost
Copy link
Owner Author

lorcalhost commented Apr 6, 2021

This issue was created in an attempt to fix sometimes getting outdated data from the database.
After a few days of testing on PR #24 I have to say the behavior has not changed.

Furthermore I believe this issue should not be resolved / does not have high priority.

@lorcalhost lorcalhost added priority:low and removed warn:help wanted Extra attention is needed labels Apr 6, 2021
@titulebolide
Copy link
Collaborator

Hey @lorcalhost
Regarding the updating of the sqlalchemy db, I'm not sure you have any way of retrieving the data, because the idea behind the update at the end of the session is to avoid repetitive writes to the disk. The data is only cached on a local session probably proper to the socket. If you open a new socket to the db you probably won't be ble to see the pending changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low type:enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants