{"id":18031496,"url":"https://github.com/debhere/predict-crypto-price","last_synced_at":"2026-05-02T03:32:01.480Z","repository":{"id":257896494,"uuid":"861856483","full_name":"debhere/Predict-Crypto-Price","owner":"debhere","description":"A Machine Learning based application to predict the Bitcoin price","archived":false,"fork":false,"pushed_at":"2024-10-21T16:09:58.000Z","size":3230,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T06:24:16.532Z","etag":null,"topics":["bitcoin","coinbase","crypto","predictor"],"latest_commit_sha":null,"homepage":"https://predict-crypto-price.onrender.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debhere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-23T16:14:41.000Z","updated_at":"2024-10-15T09:39:11.000Z","dependencies_parsed_at":"2024-12-18T01:43:22.169Z","dependency_job_id":"4d5a9450-04e1-4482-8e8e-3e87dfab89d6","html_url":"https://github.com/debhere/Predict-Crypto-Price","commit_stats":null,"previous_names":["debhere/predict-crypto-price"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debhere%2FPredict-Crypto-Price","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debhere%2FPredict-Crypto-Price/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debhere%2FPredict-Crypto-Price/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debhere%2FPredict-Crypto-Price/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debhere","download_url":"https://codeload.github.com/debhere/Predict-Crypto-Price/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256072,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","coinbase","crypto","predictor"],"created_at":"2024-10-30T10:09:21.859Z","updated_at":"2026-05-02T03:32:01.410Z","avatar_url":"https://github.com/debhere.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Predict Crypto-Currency Price\r\n\r\nThis project is a Machine Learning implementation to predict the time weighted average price (TWAP) for a crypto currency asset (currently only Bitcoin). The project is deployed on cloud and can be accessed with through https://predict-crypto-price.onrender.com/\r\n\r\n## Authors\r\n\r\n- [@debhere](https://www.github.com/debhere)\r\n\r\n\r\n## History\r\n\r\n- ver_0.0.1: deployed on Oct 7, 2024. Base model created with facebook prophet trained with 9 months (6 Oct, 2024) worth of OHLC data from 1 Jan, 2024 to 6 Oct, 2024 to predict ONLY Bitcoin price.\r\n\r\n## Tech Stack\r\n\r\n**Server:** Streamlit\r\n\r\n**Languages:** Python, T-SQL, Bash Script\r\n\r\n**Machine Learning:** Meta Prophet\r\n\r\n**Database:** Sql-Server 19\r\n\r\n\r\n## Dataset\r\n\r\nData collection is a key step in any machine learning initiative. The dataset contains 9 month (till Oct 6, 2024) worth of bitcoin ohlc (open, high, low, close) prices over a granularity of 5 mins. \r\n\r\nIn order to do that, the coinbase api https://docs.cdp.coinbase.com/exchange/reference/exchangerestapi_getproductcandles is invoked and the data is stored in a local sql-server database.\r\n\r\nIt is a general ETL (Extract, Transform, Load) methodology where the data is extracted from an external api, transformed as applicable and loaded into the database. \r\n\r\n## Database\r\n\r\nAs mentioned earlier, the collected data is stored locally into a sql-server database. Refer the sql script [here](/scripts/database/crypto.sql) to create the database schema.\r\n\r\nPresently, only one table is created for Bitcoin.\r\n\r\n## Requirements\r\n\r\n- **python 3.11+**\r\n- **streamlit**\r\n- **sckit-learn**\r\n- **numpy**\r\n- **pandas**\r\n- **pyyaml**\r\n- **joblib**\r\n- **sqlalchemy**\r\n- **fire**\r\n- **prophet**\r\n- **requests**\r\n\r\n## Run Locally\r\n\r\nClone the project\r\n\r\n```bash\r\n  git clone https://github.com/debhere/Predict-Crypto-Price.git\r\n```\r\n\r\nGo to the project directory\r\n\r\n```bash\r\n  cd Predict-Crypto-Price\r\n```\r\n\r\nCreate virtual environment\r\n\r\n```bash\r\n  conda create -p venv python=3.11 -y\r\n```\r\n\r\nActivate virtual environment\r\n\r\n```bash\r\n  conda activate venv\\\r\n```\r\n\r\n\r\nInstall dependencies\r\n\r\n```bash\r\n  pip install -e .\r\n```\r\n\r\ncreate the database schema in sql server. Refer the script at /scripts/database/crypto.sql\r\n\r\n\r\ncollect the data and insert into the database\r\n\r\n```bash\r\n./scripts/data_prep.sh\r\n```\r\n\r\nStart the server\r\n\r\n```bash\r\n  streamlit run app.py\r\n```\r\n\r\n## Description\r\n\r\nThere are 3 main sections (if you will) for this project:-\r\n\r\n- Extract-Transform-Load\r\n- Model Implementation \u0026 Pipeline\r\n- Streamlit server for front-end\r\n\r\nThe presentation layer (front-end) is very light-weight at this moment with the solitary aim to grab user input and predict the Bitcoin TWAP price. \r\n\r\n\r\n### Extract-Transform-Load (ETL)\r\n\r\n*scripts* contains the source code of the ETL pipeline. Ensure to update the database server name in the db config file [here](/scripts/_config/database.yaml). Upon running the shell script data_prep.sh, the ohlc data will be inserted into the database. Consider this piece as the pre-requisite as until the data collection is done the learning process cannot be started.\r\n\r\nCurrently, the data is corrected for the period of 6 months (01-Jan-2024 to 30-Sep-2024). Change the start and end date within the script for any preferred date range. Ensure to delete any existing data from the table before running the shell script or else the data will be appended.\r\n\r\n### Model Implementation\r\n\r\n*predictcrypto* contains the primary source code of the entire model implmentation mechanism. The primary components is \"train\" while \"cmg\" is the component manager.\r\n\r\n*pipeline* contains the data-pipeline and tranformation-pipeline\r\n\r\n*utils* directory comprises of utility functions and methods that is being referred throughout the project.\r\n\r\ntrainer.sh script is run to train the model and generate the serialized model in a json file which is preferred format for 'prophet'.\r\n\r\n### Front-End\r\n\r\nStreamlit framework is used for a fast deployment of the front-end web interface. User can provide the inputs, the model is invoked to return the prediction on the web itself.\r\n\r\n\r\n### Upcoming Changes\r\n\r\n1. Support for multiple crypto assets.\r\n2. Tune the model.\r\n3. Schedule the data collection.\r\n4. Verify the prediction w.r.t current price.\r\n5. Integrate MlOps for efficient model registry.\r\n6. If possible migrate the database from local to cloud.\r\n\r\n## Support\r\n\r\nFor any query or discussion, email debmalya.mondal@outlook.com or send me a message on \r\n\r\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/debmalyamondal)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebhere%2Fpredict-crypto-price","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebhere%2Fpredict-crypto-price","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebhere%2Fpredict-crypto-price/lists"}