This project provides a tool to calculate and visualize the sale price of Coretime over blocktime based on various parameters. It is implemented in Python and utilizes the Streamlit library for creating an interactive web application.
This repository is meant to be from Lastic for the entire community therefore it will be forever open source under the GPLv3 license. If there are some changes you want to see, or have disagreements with the implementation, feel free to open up an issue and/or contribute with a pull request.
- Interactive sliders to adjust sale parameters.
- Real-time graph visualization of sale prices over time.
- Configurable region lengths and lead-in lengths for sale price calculation.
- Adaptation of sale price based on the number of cores sold.
-
Clone the repository:
git clone https://github.com/LasticXYZ/price-simulation.git cd price-simulation
-
Build and run the application using Docker Compose:
docker-compose up --build
-
Access the application at
http://localhost:8501
. -
To stop and remove the containers:
docker-compose down
Optionally, to remove volumes as well:
docker-compose down -v
-
To run tests with Docker run the command:
docker-compose run --rm test
- Python 3.x
- Pip (Python package installer)
- Docker (optional, for containerized deployment)
- Docker Compose (optional, for managing multi-container Docker applications)
-
Clone the repository:
git clone https://github.com/LasticXYZ/price-simulation.git cd price-simulation
-
Create and activate a virtual environment (optional but recommended):
python -m venv .venv source .venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
or install the main requirements with:
pip install numpy matplotlib streamlit
-
Run the Streamlit application:
streamlit run main.py
To run unit tests for this project, execute the following commands:
-
Install the required packages for testing:
pip install -r requirements.txt
-
Run the tests:
python -m unittest discover
This will execute all unit tests in the project.
- Adjust the parameters using the sliders on the left panel.
- Observe the real-time changes in the sale price graph.
- The sale price is recalculated at the end of each region based on the number of cores sold.
You can configure various parameters of the sale price calculation in the config.py
file. Please refer to the comments in the file for explanations of each parameter.
Contributions are welcome! Please feel free to submit pull requests, create issues for bugs and feature requests, or provide feedback.
This project is licensed under the GPLv3 License - see the LICENSE file for details.
Project Link: https://github.com/lastic_xyz/price-sumulation