Thank you for your interest in contributing to PolyBot! This document provides guidelines and information for contributors.
-
Clone the repository
git clone https://github.com/cryptuon/polybot cd polybot -
Install dependencies
# Install Python dependencies with uv (recommended) uv sync --dev # Or with pip pip install -e ".[dev]"
-
Install frontend dependencies
cd frontend npm install cd ..
-
Set up pre-commit hooks (optional but recommended)
uv run pre-commit install
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/polybot --cov-report=html
# Run specific test file
uv run pytest tests/unit/test_strategies.py -v# Linting
uv run ruff check src/ tests/
# Format check
uv run ruff format --check src/ tests/
# Type checking
uv run mypy src/polybot/- Check existing issues - Search GitHub Issues first
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Python version, etc.)
- Check the roadmap - Feature might already be planned
- Open a discussion - For major features, discuss first
- Create an issue with:
- Use case description
- Proposed solution
- Alternatives considered
- Fork the repository
- Create a feature branch
git checkout -b feature/my-feature
- Make your changes
- Write tests for new functionality
- Update documentation if needed
- Follow code style guidelines
- Run tests and linting
uv run pytest uv run ruff check src/ tests/ uv run mypy src/polybot/
- Commit with clear messages
git commit -m "Add feature: brief description" - Push and create PR
git push origin feature/my-feature
- One feature per PR - Keep PRs focused
- Write tests - Cover new functionality
- Update docs - If behavior changes
- Follow style - Match existing code patterns
- Add changelog entry - For user-facing changes
- Type hints - Required for all functions
- Docstrings - Google style for public APIs
- Line length - 100 characters max
- Imports - Sorted with ruff
Example:
async def process_signal(
signal: Signal,
executor: ExecutorService,
*,
validate: bool = True,
) -> OrderResult:
"""Process a trading signal.
Args:
signal: The trading signal to process.
executor: Executor service instance.
validate: Whether to validate before execution.
Returns:
Result of the order execution.
Raises:
ValidationError: If signal validation fails.
"""
if validate:
await signal.validate()
return await executor.execute(signal)- ESLint - Follow Vue.js style guide
- Components - Single file components
- Composition API - Preferred over Options API
polybot/
├── src/polybot/ # Main Python package
│ ├── api/ # FastAPI routes
│ ├── core/ # Core utilities
│ ├── db/ # Database stores
│ ├── models/ # Pydantic models
│ ├── plugins/ # AI plugins
│ ├── services/ # Background services
│ ├── strategies/ # Trading strategies
│ └── venues/ # Venue integrations
├── frontend/ # Vue.js dashboard
├── tests/ # Test suite
├── documentation/ # MkDocs documentation
└── deploy/ # Deployment configs
- Create
src/polybot/strategies/my_strategy.py - Inherit from
BaseStrategy - Implement
scan()andshould_exit() - Register in
strategies/__init__.py - Add tests in
tests/strategies/test_my_strategy.py - Document in
documentation/docs/user-guide/strategies/
See Custom Strategy Guide for details.
- Create
src/polybot/plugins/my_plugin.py - Inherit from
AIModelPlugin - Implement required methods
- Register in plugin discovery
- Add tests and documentation
See AI Plugin Guide for details.
- Discord: Join our server
- Discussions: GitHub Discussions
- Email: team@cryptuon.com
By contributing, you agree that your contributions will be licensed under the MIT License.