Skip to content

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.

Notifications You must be signed in to change notification settings

ogu83/BitcoinChainDataAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin Chain Data Analyzer

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.


🚀 How to Run

  1. Create and activate a virtual environment:
python -m venv venv
venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Train the model and generate predictions:
python train.py --data_dir ./data --target market_price --horizon 1 --out_png prediction.png

📊 Findings

  • 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.


⚠️ Why errors are relatively high?

  1. Blockchain-only features – Metrics like transaction fees, hash rate, difficulty, addresses, etc. capture fundamentals, but price is also influenced by macroeconomics, speculation, and regulations.
  2. Non-stationarity – Correlations change between bull and bear markets.
  3. Lagging indicators – Many on-chain signals follow the price instead of leading it.

📈 Prediction Result

Here’s an example of actual vs predicted prices:

Prediction


✅ Bottom Line

  • 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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages