Juan I.
ES
Back to projects

Power Law Bitcoin - Analysis Dashboard

Interactive dashboard that fits 15 years of Bitcoin prices to a power law, decomposes cycles with FFT, detects market phases, and generates trading signals. No backend, runs 100% in the browser.

React 19 TypeScript 5.9 Vite 8 Lightweight Charts 5 Canvas API Tailwind CSS CoinGecko API
Power Law Bitcoin - Analysis Dashboard

Features

Power Law Regression

OLS in log-log space with R² = 0.96 on data since 2009. Support (-2σ) and resistance (+2σ) bands

Fourier Analysis (FFT)

Cooley-Tukey radix-2 on residuals. 8 harmonics with interactive toggles and 730-day forecast

Phase Detection

Automatic classification into 4 phases (accumulation, bull, distribution, bear) from Fourier signal and derivative

Trading Signal

BUY/SELL/HOLD with confidence percentage, combining Z-Score and market phase

Real-Time Data

Current price every 60s and 365d history every 5min via CoinGecko, merged with bundled data since 2009

Peak Estimation

Next cycle peak projection with estimated date and price from Fourier forecast

Architecture

Frontend React 19 + Vite 8, no backend. All math runs in the browser
Main Chart Native Canvas API for dual log-log scale with zoom, tooltips, and halving/peak annotations
Secondary Charts Lightweight Charts 5 for residuals (histogram) and Fourier (time series with forecast)
Data Pipeline CoinGecko API + bundled historical data (1,431 lines). ISO date deduplication, automatic merge
Analysis Single useMemo computing regression, residuals, FFT, reconstruction, phases, signal, and peak estimation