Freqtrade is a production-grade cryptocurrency trading bot written in Python. It provides a full-fledged platform for designing, backtesting, and executing automated trading strategies across major exchanges (Binance, Kraken, Bybit, OKX, etc.) via the CCXT library. The bot supports both spot and futures trading, dry-run simulation, and live deployment with docker and systemd integration. At its core, it exposes a plugin architecture for strategy definitions, pairlist filters, and risk protection modules, all configured through a unified YAML/JSON configuration system. It also includes an embedded REST API and WebSocket server for remote monitoring and control, with optional Telegram and Discord notification channels. Beyond live trading, freqtrade offers a comprehensive research subsystem: a deterministic backtesting engine with realistic fee/slippage modeling, hyperparameter optimization (hyperopt) using Optuna with over a dozen loss functions, and a machine learning module (FreqAI) that integrates sklearn, XGBoost, LightGBM, PyTorch, and reinforcement learning (SB3). The codebase includes tools for lookahead and recursive analysis to detect strategy biases, plus data download/convert/clean utilities supporting multiple storage formats (feather, parquet, JSON). Architecturally, the project follows a modular design with clear separation of concerns: exchange abstraction layer, strategy resolver, data provider, persistence (SQLAlchemy), and RPC multiplexing. It uses dependency injection through resolvers, a logging mixin for debounced messages, and a custom scheduler for periodic tasks. The test suite is extensive with over 800 test files covering all major components. While the codebase is large and some modules (e.g., exchange-specific subclasses) are tightly coupled to CCXT, many internal patterns such as the plugin system, resolver, and data handler interfaces are well-abstracted and could be extracted for reuse in other Python trading or data pipeline projects.
CCXT is a cryptocurrency exchange trading library that provides a unified API for over 100 exchanges across 7 programming languages (TypeScript/JavaScript, Python, PHP, C#, Go, Java). The core is written in TypeScript from which all other language bindings are transpiled. It implements both REST and WebSocket APIs for market data, trading, and account management. The library normalizes exchange-specific data formats into a common schema, enabling cross-exchange arbitrage and analytics. Key architectural patterns include a base Exchange class with exchange-specific subclasses, a pro/ subdirectory for WebSocket-enabled exchanges, static_dependencies/ for vendored third-party code (ethers, starknet, bip39, etc.), and an extensive test suite with both static and live tests. The repository includes a playground (Next.js web IDE), CLI tool, documentation site (Fumadocs), CI/CD for all languages, and Docker development environment.