This project is a Python-based script designed to calculate the daily yield of a cryptocurrency investment portfolio. By fetching historical price data from the CryptoCompare API and simulating daily investments, the script computes the portfolio’s value and yield rate over time.
config_v1.json
) to determine which cryptocurrencies to include in the portfolio and their respective allocation percentages.Python Packages: The script requires the requests
library to fetch data from the CryptoCompare API. You can install it using pip:
pip install requests
Clone the Repository:
git clone https://github.com/yourusername/yourrepository.git
cd yourrepository
config_v1.json
file with the cryptocurrencies and allocation percentages you want to use in the analysis.Run the Script:
python main.py
config_v1.json
)The configuration file specifies the coins to include in the portfolio and their respective allocation percentages. Here is an example configuration:
{
"version": "v1",
"coins": {
"BTC": 50,
"ETH": 10,
"LTC": 5,
"DOGE": 5,
"BCH": 5,
"ADA": 5,
"SOL": 5,
"FIL": 5,
"TON": 5,
"XEC": 3,
"DASH": 2
}
}
YYYYMMDD.price.json
): Contains the fetched prices of all cryptocurrencies at midnight (UTC) for a specific day.YYYYMMDD.yield.json
): Contains the portfolio value, total investment, quantities of each cryptocurrency, and yield rate for a specific day.This project includes a GitHub Actions workflow (.github/workflows/main.yml
) that automates the daily execution of the script at 01:00 UTC and commits the output files to the repository.
To manually trigger the workflow:
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue for any bugs, suggestions, or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.