This project provides a framework for analyzing and visualizing the correlation between multiple cryptocurrency tokens using historical price data from the CoinGecko Pro API. Users can dynamically select any set of tokens, fetch their price histories, compute correlations and volatilities, and visualize these relationships with heatmaps.
- Dynamic Token Selection: Input any list of token IDs (e.g.,
bitcoin,ethereum,solana) for analysis. - Automated Data Fetching: Retrieves historical price data from the CoinGecko Pro API.
- Data Alignment: Resamples and aligns price data to a common time interval for accurate correlation analysis.
- Correlation Heatmap: Visualizes the correlation matrix between selected tokens using Seaborn and Matplotlib.
- Volatility Analysis: Computes and displays the volatility (standard deviation of log returns) for each token.
- Efficient Data Storage: Uses
joblibfor fast saving and loading of large DataFrames.
- Python 3.7+
- Install dependencies:
pip install -r requirements.txt
-
Clone the repository:
git clone https://github.com/yourusername/token-heatmap.git cd token-heatmap -
Set up your
.envfile with your CoinGecko Pro API key:GECKO_API=your_api_key_here -
Run the Jupyter Notebooks in the
Notebooks/directory:01_data.ipynb: Fetch and store historical price data for your chosen tokens.token_correlation.ipynb: Load the data, compute correlations and volatilities, and visualize the results.
MIT License
**Feel free to fork,