A Python-based bot for interacting with the IPOR Fusion Alpha platform.
This bot provides an example implementation for automating interactions with the IPOR Fusion Alpha. It demonstrates how to connect to the platform, retrieve data, and execute trades programmatically.
- Docker
- Python 3.11 or newer
- Poetry (Python dependency management)
-
Configure Environment Variables:
Create a
.envfile in the root directory of the project by copying the provided example:cp .env.example .env
Then, edit the
.envfile and replace the placeholder values with your actual credentials:PROVIDER_URL: Your Base blockchain provider URLPRIVATE_KEY: Your wallet private keyPLASMA_VAULT_ADDRESS: The address of the IPOR Plasma Vault
-
Install Dependencies:
poetry install
-
Run Tests:
poetry run pytest
Execute the bot with the following command:
poetry run python main.pyThe bot will:
- Connect to the Base blockchain network using the provided credentials
- Initialize the IPOR Plasma Vault system
- Execute the trading strategy at the configured interval (default: 60 seconds)
The project includes Docker configuration for easy deployment:
-
Docker Files:
Dockerfile- Configures the Python environment for the alpha botDockerfile.anvil- Sets up the Foundry environment with anvil for local blockchain testingdocker-compose.yml- Orchestrates both services with proper networking
-
Running with Docker:
docker-compose up -d
This will start:
- An anvil instance for local blockchain simulation
- The alpha bot container connected to the anvil service
To customize the bot's behavior:
- Modify the
AlphaBot.do_fusion()method inalpha_bot.pyto implement your strategy - Adjust the scheduling interval in
main.py - Add additional environment variables as needed
main.py- Entry point that sets up environment and initializes componentsalpha_bot.py- Core bot implementation with trading strategiesscheduler.py- Handles periodic execution of the bot's operations
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.