Skip to content

Development Documentation

This directory contains comprehensive documentation for developing and contributing to Cracktrader.

Getting Started

Key Areas

Development Process

  • Modern Python development workflow
  • Automated quality assurance with pre-commit hooks
  • Comprehensive CI/CD pipeline with GitHub Actions
  • Contract, replay, and runtime validation in CI

Code Quality

  • Ruff: Primary linting and import-order checks
  • Black: Code formatting backup
  • isort: Import sorting in pre-commit
  • Type checking: MyPy integration

Testing Strategy

  • Unit: fast, isolated component testing
  • Integration: cross-component behavior using a fake exchange
  • E2E (optional): sandbox/live validation for critical paths
  • Contract, replay-regression, and web smoke suites in CI

CI/CD Pipeline Features

  • Matrix testing (Python 3.11, 3.12)
  • Dependency caching
  • Parallel test execution
  • Rust parity gates
  • Build verification
  • Artifact collection

Architecture Overview

Cracktrader is a high-performance cryptocurrency trading framework:

  • 7,400 lines of source code
  • 19,200+ lines of comprehensive tests
  • 100+ exchanges supported via CCXT
  • Sub-minute timeframes (1s, 10s, 30s) with tick reordering
  • Native-first runtime with analyzer and strategy protocols

Performance Benchmarks

  • Data Processing: 55,000+ candles/second
  • Tick Reordering: 53,000+ candles/second with chronological sorting
  • Memory Efficiency: <1MB for 1000 high-frequency candles
  • Build Time: ~2-5 minutes for full CI/CD pipeline

Contributing

  1. Follow the Development Workflow
  2. Ensure all tests pass and code quality checks succeed
  3. Add tests for new functionality
  4. Update documentation as needed
  5. Submit pull requests against main branch

The development workflow is designed to catch issues early and maintain production-ready code quality through automated testing and quality assurance.