An implementation of the models described in "Are Bitcoin Bubbles Predictable? Combining a Generalized Metcalfe's Law and the LPPLS Model" (arXiv:1803.05663) in Mathematica.
This repository contains implementations of:
- LPPLS Model: Log-Periodic Power Law Singularity model for predicting bubble breakouts/crashes.
- Metcalfe's Law Model: Using active Bitcoin addresses as a proxy for network users to assess overvaluation.
- Mathematica: Version 12.0 or later (tested with versions 12.0 and 13.2).
- R: Required for some auxiliary scripts and data processing (
loessdof estimation).
-
Install Dependencies:
- Mathematica 12.0 or later.
- R (for auxiliary scripts).
-
Run the Overvaluation Model:
- Open
bitcoinUsersCsvNoVAuto.nbin Mathematica. - The notebook automatically downloads data from online sources.
- Execute all cells (Cell → Evaluate Notebook).
- Results are exported to the
pdf/folder.
- Open
-
Run LPPLS Model:
- Open the appropriate LPPLS notebook (e.g.,
LPPLS25.nbfor 2025 predictions). - Execute all cells.
- The model will fit price data and attempt to identify bubble regimes.
- Open the appropriate LPPLS notebook (e.g.,
The notebooks automatically fetch data from:
- Bitcoin price data: cryptodatadownload.com
- Active addresses: bitinfocharts.com
- Market capitalization: bitinfocharts.com
Note: Ensure you have internet connectivity for automatic data download.
- PDF files: Generated plots and analysis saved to
pdf/folder. - PNG files: Generated plots saved to
png/folder. - CSV files: Processed data saved to
csv/folder (if generated).
The Log-Periodic Power Law Singularity model attempts to identify bubble regimes by detecting log-periodic oscillations in price data that precede crashes. The model fits price data to detect critical points where bubbles may burst.
Uses active Bitcoin addresses as a proxy for network users. Fits Bitcoin market capitalization to a generalized Metcalfe's law model (value ∝ n², where n is the number of users). Compares actual market cap to the model's prediction to assess overvaluation.
- LPPLS18.nb - Breakout prediction for the 2018 bubble.
- LPPLS21.nb - Breakout prediction for the 2021 bubble.
- LPPLS23.nb - Breakout prediction for the 2023 bubble.
- LPPLS24.nb - Breakout prediction for the 2024 bubble.
- LPPLS25.nb - Breakout prediction for the 2025 bubble.
- LPPLS26.nb - Breakout prediction for the 2026 bubble (ongoing/starting).
- LPPLS26-Gold.nb - Breakout prediction for the Gold price.
- bitcoinUsersCsvNoVAuto.nb - Overvaluation model with automatic data download and processing (recommended).
Note: Older versions (bitcoinUsersCsv.nb, bitcoinUsersCsvNoV.nb) have been moved to the deprecated/ folder. These earlier implementations required manual data verification or lacked automatic processing features.
The LPPLS model has a significant limitation: it produces many false positives. The model frequently signals potential bubble breakouts that do not materialize into actual crashes. This creates several problems:
- Signal fatigue: Too many warnings make it difficult to distinguish real signals from noise.
- Low precision: Many false alarms relative to actual crashes.
- Limited practical utility: Without a reliable way to filter false positives, the model's predictive value is severely diminished.
Historical Performance: The model successfully predicted the 2021 Bitcoin crash, but has not performed well for subsequent bubble periods. This inconsistency further limits its reliability.
The Metcalfe's law model uses active Bitcoin addresses as a proxy for network users. This approach has become increasingly problematic:
- Lightning Network Impact: The introduction of Lightning Network (LN) around 2020 means a growing portion of Bitcoin transactions occur off-chain.
- Missing Activity: LN transactions do not appear in on-chain active address data, creating a systematic undercount of actual network usage.
- Proxy Validity: The active addresses metric becomes less valid as a proxy for total network activity over time.
Attempted Mitigation: An attempt was made to cap user data to ~2020 (the peak in active addresses) and extrapolate using an exponential trend. However, this approach replaces hard data with assumptions, which undermines the model's empirical foundation and is not a satisfactory solution.
Data Gap: Reliable historical time series data for Lightning Network usage/transactions is not readily available, making it difficult to properly account for off-chain activity.
- Metcalfe's Law: Assumes network value scales as n², which may not hold for Bitcoin.
- Single Metric: Relies primarily on active addresses, ignoring other factors (speculation, institutional adoption, regulation, etc.).
- Market Complexity: Real markets are influenced by many factors beyond network size.
- Data Freshness: Results become stale quickly as new data arrives.
- Model Drift: The relationship between active addresses and market cap may change over time.
- Regime Changes: Market dynamics may shift in ways the model doesn't capture.
This software is provided for educational and research purposes only.
- Not Investment Advice: This software does not constitute financial, investment, or trading advice.
- No Warranty: The models may be inaccurate, incomplete, or produce incorrect results.
- Use at Your Own Risk: Any use of this software for investment decisions is at your own risk.
- Past Performance: Past model performance (e.g., 2021 prediction) does not guarantee future accuracy.
- Research Tool: This is a research implementation, not a production trading system.
The authors and contributors are not responsible for any financial losses or damages resulting from the use of this software.
- Are Bitcoin Bubbles Predictable? Combining a Generalized Metcalfe's Law and the LPPLS Model - arXiv:1803.05663.
- Transaction Dynamics of Blockchain and Predictable Bitcoin Bubbles.
- Metcalfe's Law.
- Bitcoin active addresses: bitinfocharts.com.
- Bitcoin market capitalization: bitinfocharts.com.
- Bitcoin price data: cryptodatadownload.com.
- Bitcoin circulating supply: blockchain.com.
This project is provided for educational and research purposes. See the LICENSE file for details.
If you use this code in your research, publications, or projects, please provide appropriate attribution:
When citing this implementation, please include:
- This repository: Bitcoin-bubbles.
- Original academic paper: "Are Bitcoin Bubbles Predictable? Combining a Generalized Metcalfe's Law and the LPPLS Model" (arXiv:1803.05663).
- Author: Mauro Lacy Bopp.
Mauro Lacy Bopp. (2025). Bitcoin Bubble Prediction Models - Mathematica Implementation.
GitHub Repository: [Bitcoin-bubbles](https://github.com/maurolacy/bitcoin-bubbles).
Based on: Sornette et al. (2018). "Are Bitcoin Bubbles Predictable? Combining a Generalized
Metcalfe's Law and the LPPLS Model." arXiv:1803.05663
For commercial use or incorporation into commercial products, please contact the author for permission.