A simplified scheduler tool to execute recurring cryptocurrency purchases on Coinbase. This tool automates the process of buying a specified amount of cryptocurrency at regular intervals (daily, weekly, or monthly).
- π€ Automated cryptocurrency purchasing on a daily, weekly, or monthly schedule
- βοΈ Configurable purchase amount and timing
- π± Support for any Coinbase-supported cryptocurrency pair
- π¬ Telegram notifications for order status
- π₯οΈ Command-line interface for manual operations
- π³ Docker support with multi-architecture images (amd64/arm64)
- π Security scanning with Trivy for vulnerabilities and secrets
- π Automated dependency updates with Dependabot
- β‘ GitHub Actions CI/CD pipeline
- Python 3.9+
- Coinbase Advanced Trade API keys
- (Optional) Telegram Bot token for notifications
- (Optional) Docker for containerized deployment
-
Clone the repository:
git clone https://github.com/ermitovski/coinbase-scheduler.git cd coinbase-scheduler -
Create and activate a Python virtual environment:
# Create virtual environment python3 -m venv venv # Activate virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: # venv\Scripts\activate
-
Install dependencies:
# Using pip directly pip install -r requirements.txt # Or using python -m pip (recommended) python -m pip install -r requirements.txt
-
Copy the example environment file and configure it:
cp .env.example .env
-
Edit the
.envfile with your Coinbase API credentials and preferred purchase settings
For development, always work within the virtual environment:
# Activate the virtual environment
source venv/bin/activate
# When done, deactivate it
deactivateIf you encounter issues with pip on macOS, use the virtual environment's Python directly:
./venv/bin/python -m pip install -r requirements.txtThe application is configured through environment variables, which can be set in the .env file:
COINBASE_API_KEY: Your Coinbase Advanced Trade API keyCOINBASE_API_SECRET: Your Coinbase Advanced Trade API secretPRODUCT_ID: The cryptocurrency pair to trade (e.g.,BTC-EUR)AMOUNT: The amount of fiat currency to use for each purchaseBUY_TIME: The time to execute purchases (in UTC, format: HH:MM)ORDER_FREQUENCY: Frequency of purchases (daily,weekly, ormonthly)WEEKLY_DAY: Day of the week for weekly purchases (monday,tuesday, etc.)MONTHLY_DAY: Day of the month (1-28) for monthly purchasesTELEGRAM_BOT_TOKEN: (Optional) Telegram bot token for notificationsTELEGRAM_CHAT_ID: (Optional) Telegram chat ID for notifications
To start the scheduler and keep it running in the background:
python coinbase_scheduler.py
Execute a one-time purchase:
python coinbase_scheduler.py --buy-now
Show current configuration:
python coinbase_scheduler.py --show-config
Pre-built multi-architecture images (amd64/arm64) are available on GitHub Container Registry:
# Pull the latest release
docker pull ghcr.io/ermitovski/coinbase-scheduler:latest
# Or pull a specific version
docker pull ghcr.io/ermitovski/coinbase-scheduler:v1.0.0Run the container:
docker run -d \
--name coinbase-scheduler \
--env-file .env \
--restart unless-stopped \
ghcr.io/ermitovski/coinbase-scheduler:latestFor development:
docker-compose up -dFor production (uses pre-built image):
docker-compose -f docker-compose.prod.yml up -dView logs:
docker-compose logs -f- π All Docker images are automatically scanned for vulnerabilities using Trivy
- π Repository is scanned for secrets and sensitive information
- π¦ Dependencies are automatically updated via Dependabot
- π‘οΈ See SECURITY.md for our security policy
We welcome contributions! Please follow these guidelines:
This project uses Conventional Commits for clear and structured commit messages:
# Format: <type>(<scope>): <subject>
# Examples:
git commit -m "feat: add support for EUR trading pairs"
git commit -m "fix: resolve connection timeout issues"
git commit -m "docs: update configuration examples"
git commit -m "chore: update dependencies"Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes following the commit conventions
- Push to your fork:
git push origin feature/your-feature - Create a Pull Request
When a new release is created:
- Changelog is automatically generated from commit history
- Docker images are built and pushed to GitHub Container Registry
- Release notes include installation instructions and changes
This project uses GitHub Actions for continuous integration and deployment:
- On Push to main: Builds and pushes Docker images with
maintag - On Pull Request: Builds images for testing (no push)
- On Release:
- Builds and pushes images with version tags and
latest - Automatically generates changelog from commit history
- Updates release notes with Docker commands and quick start guide
- Creates pull request to update CHANGELOG.md
- Builds and pushes images with version tags and
All builds include:
- Multi-architecture support (linux/amd64, linux/arm64)
- Vulnerability scanning with Trivy
- Secret scanning
- Automated release notes generation
Logs are output to the console and include:
- Scheduler startup confirmation
- Scheduled job registrations
- Order execution results
- Error messages
When using Docker, view logs with:
docker logs -f coinbase-schedulerContributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT - see the LICENSE file for details.