This project collects multiple on-chain Bitcoin metrics from JSON files, aligns them over time, and uses LightGBM to train a regression model that predicts the market price.
- Create and activate a virtual environment:
python -m venv venv
venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Train the model and generate predictions:
python train.py --data_dir ./data --target market_price --horizon 1 --out_png prediction.png- We successfully merged 30+ blockchain metrics (e.g., hash rate, difficulty, unique addresses, transaction volume).
- Trained a LightGBM regressor on the aligned dataset.
- Evaluation metrics:
MAE : ~14,697
RMSE : ~23,320
MAPE % : ~21.25
R² : ~0.47
This means the model explains about half of the market price variance.
- Blockchain-only features – Metrics like transaction fees, hash rate, difficulty, addresses, etc. capture fundamentals, but price is also influenced by macroeconomics, speculation, and regulations.
- Non-stationarity – Correlations change between bull and bear markets.
- Lagging indicators – Many on-chain signals follow the price instead of leading it.
Here’s an example of actual vs predicted prices:
- Blockchain metrics do provide signal (R² ≈ 0.47).
- However, they are not sufficient alone for precise price prediction.
- Improvements could come from:
- Adding macro and sentiment data (S&P 500, dollar index, Google Trends, Twitter/Reddit).
- Predicting returns instead of raw prices.
- Using sequence models (LSTM, GRU, Transformers) to capture temporal dependencies.
