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

On opt-in basis, keep track of DCA performance #36

Open
jorijn opened this issue Jun 30, 2020 · 3 comments
Open

On opt-in basis, keep track of DCA performance #36

jorijn opened this issue Jun 30, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@jorijn
Copy link
Owner

jorijn commented Jun 30, 2020

Someone opted the idea to let Bitcoin DCA report how your DCA strategy is performing. Ideally the app would write the transactions to some sort of database and when the user would request statistics, fetch the current price and show how much % the user has progressed.

@jorijn jorijn added the enhancement New feature or request label Jun 30, 2020
@Sebastix
Copy link
Contributor

Sebastix commented Nov 13, 2021

There is already some sort of logging build into the app right? When you provide the tag (-t) argument to the buy command, the buy is attached to a tag (https://bitcoin-dca.readthedocs.io/en/latest/tagged-balance.html#tagged-balance). This info is written down in a JSON file in de application dir /var/storage/balance.db
My idea:

  • Add enviroment variable (boolean) to enable logging all buy transactions (or call it a portfolio feature maybe)
  • When enabled, a new record is written into a JSON with the amount of bought btc and the timestamp (and maybe also the price in fiat you paid otherwise you should get this price from a third party exchange)
  • To check the performance overall, an interface (application) would be ideal which reads all the info from the json and a API request (for example coindesk or the exchange which is used for the buy) is used to get the current btc price. This interface/application could be fully client-side, so you can easily open this at anytime without any use of Docker.

@jorijn
Copy link
Owner Author

jorijn commented Nov 14, 2021

I like this idea. Yet, isn't SQLite better? Using JSON as a (growing) database isn't very efficient since the code has to parse the entire file every time a line should be added. This would also help in the event of a web interface as SQLite offers basic query functions like GROUP BY and SUM, offloading this logic to presumably more efficient (than PHP) native functions.

@Sebastix
Copy link
Contributor

Sebastix commented Nov 14, 2021

I agree using a SQLite database is better, but then we need a Docker container to run this database I think?
Another question arises to me, is it possible to query this database from the client / application (Javascript)? Make use of an library like https://github.com/sql-js/sql.js? Or perhaps using IndexedDB is an option? Don't have hands-on expierence with both.

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

No branches or pull requests

2 participants